Special thanks to Greg and Christian.
Here’s a method that works: (See below for comments.)
Public Sub SaveToPhotosAlbum(Extends pPict As Picture)
// IMPORTANT: Must turn on Photos Access in iOS Build Settings Advanced
Declare Sub UIImageWriteToSavedPhotosAlbum Lib “UIKit” _
(img As ptr, target As ptr, sel As ptr, info As ptr)
Var pt As Ptr
pt = pPict.CopyOSHandle(Picture.HandleType.iOSUIImage)
- In Xojo 2020 2.1 Picture.handle returns 000000.
- Somewhere in the docs about memory blocks it suggests that one can pass a memory block to a declare. You can, but no picture.
- It’s essential to turn on access to Photos in the Advanced tab. If not, boom.
- Finally, once I had things working, I discovered that the picture was blank. In my app, I had made the picture but didn’t draw its contents!
Hope this helps.