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

view 转为image 清晰度不变

2016-01-26 14:21 309 查看
-(UIImage *)getImageFromView:(UIView *)theView

{

    //scale 为2可以改为2倍图的清晰度,plus可以改为3,

float scale = 2;

    UIGraphicsBeginImageContextWithOptions(theView.bounds.size,
YES, scale);

    [theView.layer
renderInContext:UIGraphicsGetCurrentContext()];

    UIImage *image=UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    return image;

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