1
我從UIGraphicsGetImageFromCurrentImageContext獲取UIImage,但它們非常重量級的內存明智。轉換UIImage圖像表示
UIGraphicsBeginImageContext([self bounds].size);
// CGContext procedures
_cacheImage = UIGraphicsGetImageFromCurrentImageContext();
圖像的大小几乎與iPad的屏幕大小,(有點小),當我做這樣的事情:
NSData *data = UIImagePNGRepresentation(_cacheImage)
NSLog(@"%i", data.lenght);
它給了我像lenght 700000 。我猜測它的一個.7MB文件?
無論如何,如果有一些方法來減少圖像尺寸,請讓我知道。