I was using UIGetScreenImage in my app, however, as everyone knows Apple is rejecting apps using private APIs. I have researched alternate ways to do this with takepicture but you get different size images as well as the annoying snapshot sound. Microsoft tag. Quickmark and Redalaser all use the UIGetScreenImage (it's obvious) but I want to do this legally. Does anyone out there have any suggestions. Much appreciated.
Asked
Active
Viewed 3,980 times
1
-
1It might not be the best user experience, depending on your app, but is it possible that you could ask the user to take a screen shot and then get it from the camera roll? – bpapa Dec 04 '09 at 21:14
3 Answers
3
This might work... I think that it was the answer to another SO question.
-(UIImage *)captureView:(UIView *)view {
CGRect screenRect = [[UIScreen mainScreen] bounds];
UIGraphicsBeginImageContext(screenRect.size);
CGContextRef ctx = UIGraphicsGetCurrentContext();
[[UIColor blackColor] set];
CGContextFillRect(ctx, screenRect);
[view.layer renderInContext:ctx];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}

Brad Larson
- 170,088
- 45
- 397
- 571

jessecurry
- 22,068
- 8
- 52
- 44
3
UIGetScreenImage
is currently Apple's recommended way of capturing the screen. It's sort of a private method, but they've stated in the developer forums that using it is acceptable until they add a public-API equivalent.
Update: UIGetScreenImage
is no longer allowed, as of iOS 4; I believe the approved way to take pictures is now using the AVFoundation framework.

Noah Witherspoon
- 57,021
- 16
- 130
- 131