0
我試圖調整圖像的最大寬度爲1000px,但原始圖像分辨率的「比例」需要保持不變。即1000x1300或1000x1600等用原始比例調整UIImage的大小
我需要對下面的代碼進行哪些更改?
- (void)setImageAndConvertToThumb:(UIImage *)image {
//image
UIImage *sizedImg = [image scaleWithMaxSize:CGSizeMake(1000, 1000) quality:kCGInterpolationHigh];
NSData *data = UIImagePNGRepresentation(sizedImg);
self.image = data;
}
可能重複[Resize UIImage with aspect ratio?](http://stackoverflow.com/questions/1703100/resize-uiimage-with-aspect-ratio) – DarkDust 2012-02-13 14:30:07