Anu
Anu

Reputation: 89

How to take Screen Shot of iPad Home screen programatically?

i tried below code but it take only apps background screenshot, not iPad home screenshot...

CGImageRef screen = UIGetScreenImage();
UIImage* image = [UIImage imageWithCGImage:screen];
CGImageRelease(screen);
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);

Upvotes: 0

Views: 534

Answers (2)

Abhishek
Abhishek

Reputation: 1702

Its not permitted by Apple. there are possibilities of it if phone is jailbroken.

Upvotes: 0

jrturton
jrturton

Reputation: 119242

You can't take an image of the home screen from within your app. This would violate the sandbox principle.

Upvotes: 1

Related Questions