UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, 0);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
注:image就是截取的屏幕
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, 0);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
注:image就是截取的屏幕
本文标题:iOS-截屏
本文链接:https://www.haomeiwen.com/subject/eqvrhttx.html
网友评论