iPhone开发中怎么实现截屏

- (UIImage *)capture

{

UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0);

    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];

UIImage * img = UIGraphicsGetImageFromCurrentImageContext();    UIGraphicsEndImageContext();

    return img;

}


你可能感兴趣的:(iPhone开发中怎么实现截屏)