#pragma mark -view的截图
UIGraphicsBeginImageContextWithOptions(mySharView.frame.size, mySharView.opaque, 0.0);
[mySharView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self share:img];//分享图片函数
UIImageWriteToSavedPhotosAlbum(img, self,nil, nil);//保存图片
#pragma mark -ScrollView contentSize 的截图
UIGraphicsBeginImageContextWithOptions(bgScrollView.contentSize, bgScrollView.opaque, 0.0);
[bgScrollView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self share:img];//分享图片函数
UIImageWriteToSavedPhotosAlbum(img, self,nil, nil);//保存图片
屏幕截图,view,ScrollView截图
最新推荐文章于 2018-08-22 22:01:06 发布