美文网首页
UIGraphicsBeginImageContext 对图片压

UIGraphicsBeginImageContext 对图片压

作者: inc3ption | 来源:发表于2020-06-02 22:32 被阅读0次

应改为使用 UIGraphicsBeginImageContextWithOptions 方法

 // 压缩有失真,图片会不清晰(scale为1)
UIGraphicsBeginImageContext(CGSize size); 

// 压缩不会特别失真,scale设置为0,opaque 为NO
UIGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale);  

相关文章

网友评论

      本文标题:UIGraphicsBeginImageContext 对图片压

      本文链接:https://www.haomeiwen.com/subject/euhmzhtx.html