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; screenBuffer->readToPixels(pixels); img.setFromPixels(pixels); img.update(); ofSetColor(255); 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()
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.