Save Image to Photo Album (independent from device resolution)

hi there,

I want to save generated images to the user’s Photo Album, but don’t wann use ofxiPhoneScreenGrab as I want to create high resolution images independent from the resolution of the iPhone or iPad. I’ve come so far as using an FBO to draw my graphics which works just fine in 007.

Now I want to get the FBO content and save it. I am stuck getting the FBO pixels into an ofImage.

in my .h i have:

ofFbo* screenBuffer;    
ofImage img;    

in my .mm

ofPixels pixels;    
img.draw(0, 0);  

…which doesn’t work. (But it works perfectly fine if I draw a ofTexture and get the FBO content through getTextureReference():wink:

What am I doing wrong? Is there a problem with pointers / reference?

In the end I think I have to use UIImageWriteToSavedPhotosAlbum, so I have to convert an ofImage to an UIImage anyway, anyone done that before? Is it possible to copy ofTexture directly into an UIImage?

Thanks, any help / hints appreciated.

I’m not sure about the iPhone specific stuff, but this should work to save an FBO to a file:


I just found this topic issued about a month ago—readtopixels-issue/7392/0

The problem: readToPixels does not work on iOS. Any ideas how to solve this?