ios截屏

#pragma mark -

#pragma mark Capture

 

- (UIImage *)capture

{

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

    [self.view.layerrenderInContext:UIGraphicsGetCurrentContext()];

    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    return img;

}

你可能感兴趣的:(ios,截屏,object c)