这里是我使用的调整我的UIImage的代码,但不幸的是它不工作:如何调整我的UIImage?
UIImage *cellImage = [UIImage imageNamed:@"warning.png"];
CGRect cropRect = CGRectMake(0.0, 0.0, 12.0, 12.0);
CGImageRef croppedImage = CGImageCreateWithImageInRect([cellImage CGImage], cropRect);
UIImageView *myImageView = [[UIImageView alloc] initWithFrame:cropRect];
[myImageView setImage:[UIImage imageWithCGImage:croppedImage]];
CGImageRelease(croppedImage);
为什么这个代码不工作?
感谢
它究竟是什么做/不这样做? –
可能重复的[如何在iPhone中的Objective-C中以编程方式调整图像大小](http://stackoverflow.com/questions/4712329/how-to-resize-the-image-programatically-in-objective-c-in -iphone) –