代码如下:
CGSize itemSize = CGSizeMake(63, 63); UIGraphicsBeginImageContext(itemSize); CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height); [self.imageView.image drawInRect:imageRect]; self.imageView.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();