Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Before all, I am afraid that may cause memory warning if you load all 48 images in to memory, check it with Instrument.</p> <p>================================</p> <p>You probably need to force it do the decompressing and rendering before, check this <a href="https://stackoverflow.com/questions/14116194/any-way-to-encode-a-png-faster-than-uiimagepngrepresentation">link1</a> and this <a href="http://www.cocoanetics.com/2011/10/avoiding-image-decompression-sickness/" rel="nofollow noreferrer">link2</a></p> <p>Try this, it causes the image to decompress, even though the image context is just 1 pixel large.:</p> <pre><code>UIGraphicsBeginImageContext(CGSizeMake(1, 1)); [decompressedImage drawAtPoint:CGPointZero]; UIGraphicsEndImageContext(); </code></pre> <p>or something like this:</p> <pre><code>CGDataProviderRef imageDataProvider = CGDataProviderCreateWithCFData((__bridge CFDataRef)imageData); CGImageRef image = CGImageCreateWithJPEGDataProvider(imageDataProvider, NULL, NO, kCGRenderingIntentDefault); CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef bitmapContext = CGBitmapContextCreate(NULL, CGImageGetWidth(image), CGImageGetHeight(image), CGImageGetBitsPerComponent(image), 0, colorSpace, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little); CGColorSpaceRelease(colorSpace); CGContextDrawImage(bitmapContext, CGRectMake(0, 0, CGImageGetWidth(image), CGImageGetHeight(image)), image); CGDataProviderRelease(imageDataProvider); CGContextRelease(bitmapContext); if (image){ decompressedImage = [UIImage imageWithCGImage:image]; CGImageRelease(image); } </code></pre> <p>Hope this is helpful.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload