iOS截取屏幕(屏幕截图)


-(UIImage*)printscreen
{
    //以下是实现截屏功能
    UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    
    UIImage * jieTuImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return jieTuImage;
}






你可能感兴趣的:(iOS截屏,将屏幕截取成图片)