您的位置:首页 > 产品设计 > UI/UE

iphone--将UIView的内容转化为UIImage

2011-12-07 19:36 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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: