[英]how to reduce the UIImage size…?
我有大小为1200x1200的图像。(从服务器获取)。我可以将它减少到800x800(不使用“预览”)。由于图像大小,我的应用程序崩溃..请帮我解决这个问题。 ..提前致谢。
UIImage *image = [actualImage you want to resize];
UIImage *tempImage = nil;
CGSize targetSize = CGSizeMake(196,110);
UIGraphicsBeginImageContext(targetSize);
CGRect thumbnailRect = CGRectMake(0, 0, 0, 0);
thumbnailRect.origin = CGPointMake(0.0,0.0);
thumbnailRect.size.width = targetSize.width;
thumbnailRect.size.height = targetSize.height;
[image drawInRect:thumbnailRect];
tempImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
You can use this tempImage , it will be resized Image 你可以使用这个tempImage,它会调整Image的大小
Hope, it helps ! 希望能帮助到你 !
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.