hi.........
In this Blog, i want to Explain about taking Screen short of iphone programmatically.
its so simple and require only few lines of code.
that capture the screen short and save it the iphone photo library.
Step 1.
Make a iphone application.
Step 2.
Insert that code in viewDidLoad method of your viewController.h
CGRect screenRect = [[UIScreen mainScreen] bounds];
UIGraphicsBeginImageContext(screenRect.size);
CGContextRef ctx = UIGraphicsGetCurrentContext(); [[UIColor blackColor] set]; CGContextFillRect(ctx, screenRect);
[self.view.layer renderInContext:ctx];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIImageWriteToSavedPhotosAlbum(newImage, nil, nil, nil);
UIGraphicsEndImageContext();
that work fine and you can check by checking iphone photo library.
No comments:
Post a Comment