// 重设图片大小
func reSizeImage(reSize : CGSize) -> UIImage {
//UIGraphicsBeginImageContext(reSize);
UIGraphicsBeginImageContextWithOptions(reSize, false, UIScreen.main.scale)
self.draw(in: CGRect(x: 0, y: 0, width: reSize.width, height: reSize.height))
let reSizeImage : UIImage = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
return reSizeImage
}
iOS 调整UIImage图片大小
最新推荐文章于 2021-02-09 17:14:13 发布