How can i take screenshot from code ?
+2
A:
#include <QuartzCore/QuartzCore.h>
UIGraphicsBeginImageContext(Background.bounds.size);
[Background.window.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
kovpas
2010-10-15 20:46:06