我的问题是,在我的应用程序中,我有UIImageview
,button1
和button2
。 button1
用于访问保存的照片库中的图像,button2用于将图像存储在数据库中,
但是图片尺寸为(800x800),非常大,我想以(50x50)尺寸存储
单击button2时如何缩小图像尺寸?
最佳答案
// grab the original image
UIImage *originalImage = [UIImage imageNamed:@"myImage.png"];
UIImage *scaledImage = [UIImage imageWithCGImage:[originalImage CGImage] scale:50/800 orientation:UIImageOrientationUp];
关于ios - 如何减少UIImageView上图像显示的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5661199/