Reputation: 117
How to take screen shot when video playing? I used MPMoviePlayerController for video playing.
Upvotes: 1
Views: 1126
Reputation: 19418
- (UIImage *) captureScreen
{
UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
CGRect rect = [keyWindow bounds];
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[keyWindow.layer renderInContext:context];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
Upvotes: 4