ios截屏功能
作者:
我的天空蔚蓝色 | 来源:发表于
2015-12-11 23:01 被阅读193次-(void)ShootmeDidSuccessful{
//首先开启上下文
CGSize imageSize = self.view.bounds.size;
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0.0);
//将某个VIew的所有内容渲染到图形的上下文中
CGContextRef context = UIGraphicsGetCurrentContext();
[self.view.layer renderInContext:context];
//获得图片
UIImage * image = UIGraphicsGetImageFromCurrentImageContext();
[UIImagePNGRepresentation(image) writeToFile:@"/Users/CC/Desktop/imageName.png" atomically:YES];
}
本文标题:ios截屏功能
本文链接:https://www.haomeiwen.com/subject/zybyhttx.html
网友评论