您的位置:首页 > 移动开发 > IOS开发

ios 将view转换成image

2014-03-18 14:18 232 查看
//将UIView转成UIImage

-(UIImage *)getImageFromView:(UIView *)theView

{

//UIGraphicsBeginImageContext(theView.bounds.size);

UIGraphicsBeginImageContextWithOptions(theView.bounds.size, YES,
theView.layer.contentsScale);

[theView.layer renderInContext:UIGraphicsGetCurrentContext()];

UIImage *image=UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

return image;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: