Swift图片选择器,对图片占用内存进行了优化 //根据宽度计算高度 let height = width * size.height / size.width //按照宽高比绘制一张新的图片 let currentSize = CGSize(width: width, height: height) UIGraphicsBeginImageContext(currentSize) drawInRect(CGRect(origin: CGPointZero, size: currentSize)) let newImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return newImage
-
Notifications
You must be signed in to change notification settings - Fork 0
fangjun123/Swift-
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Swift图片选择器,对图片占用内存进行了优化
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published