I need to post screenshots from my iphone app to facebook.
I tried to use ReadPixels, but it does not work on my iPhone (but worked well in editor/browser).
I don’t want to use Application.CaptureScreenShot because it save image to the flash and i don’t need it.
How can I make screenshot? Maybe some native code approach?
In native code, you can use UIGraphicsGetImageFromCurrentImageContext…
UIGraphicsBeginImageContext(Background.bounds.size);
[Background.window.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//save to photo album, or use FileManager to save somewhere else
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
make sure you import the quartzcore framework… and include it in your header
#include <QuartzCore/QuartzCore.h>