-2

Possible Duplicate:
Programatically capture video of screen

I am building an app in which i have to capture the screen of iPhone mobile (rooted phone) remotely... Means i have to capture screen from one iPhone to another iPhone remotely...

please suggest me...

Thanks in advance.

Community
  • 1
  • 1
Bhanu
  • 1,249
  • 10
  • 17

1 Answers1

0

To programmatically capture screen snapshots, you can:

#import <QuartzCore/QuartzCore.h>

- (void)saveScreenSnapshot:(UIView *)view
{
    UIGraphicsBeginImageContext(view.frame.size);
    [view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    // do what you want with this image; I frequently just drop it in the device's photo album
    //
    // UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
}

Alternatively, can get a PNG representation of that image via:

NSData *data = UIImagePNGRepresentation(image);

You obviously have to add the QuartzCore.framework to your target app's libraries.

Rob
  • 415,655
  • 72
  • 787
  • 1,044
  • is that possible to captur screen of ios device? when application goes to background that time whatever the window is open can i take scree capture? – kalpesh Jul 28 '16 at 06:00