UIImageJPEGRepresentation如何运作?

时间:2014-12-07 18:43:11

标签: swift uiimageview uiimage uiimagejpegrepresentation

我有这行代码

UIImageJPEGRepresentation(profileImage, 0.8)

我想知道它是通过降低质量来调整图像的高度和宽度还是仅调整尺寸?

1 个答案:

答案 0 :(得分:2)

这只会降低质量。

func UIImageJPEGRepresentation(_ image: UIImage!,
                         _ compressionQuality: CGFloat) -> NSData!

来源:UIImageJPEGRepresentation