Note that there are some explanatory texts on larger screens.

plurals
  1. POimageWithCGImage not being released or is trapped by Cache similar to imageNamed, any work around for generating dynamic images?
    primarykey
    data
    text
    <p>I'm generating UIImages with a bit-bucket, creating them on the fly and swapping the UIImageView's image. Is there a way to edit the UIImageView's Image directly? (ie. change the color of a specific pixel, without removing the UIImage from the UIImageView, and get it to redraw.) </p> <p>Currently, I'm flushing the UIImage and using imageWithCGIImage to make a new one, and assigning it to the UIImageView. This works. Shows no MemLeaks. But on the iPhone (3Gs) after about 100 image replacements, CRASHES. Cache'n issue? The memory summation seems to be hitting the phone's limit if cache not releasing, however, Simulator does not show memory consumption with each image swap. Stays flatlined without leaks.</p> <p>Note: topologyImage array is the RGBA pixel-bucket. The REF variables are not released. Every attempt to do so, crashes next call. Without, Instruments reports no leaks.</p> <p>=========</p> <pre><code>CGColorSpaceRef colorSpaceRef=CGColorSpaceCreateDeviceRGB(); CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault | kCGImageAlphaLast; CGColorRenderingIntent renderingIntent=kCGRenderingIntentDefault; CGDataProviderRef provider=CGDataProviderCreateWithData(NULL,topologyImage,(I*I*4),NULL); CGImageRef imageRef=CGImageCreate(I,I,8,4*8,4*I,colorSpaceRef,bitmapInfo,provider,NULL,false,renderingIntent); UIImage *img=[UIImage imageWithCGImage:imageRef]; if( IMG[NDXtopo].vw ) { [IMG[NDXtopo].vw setImage:img]; } else { IMG[NDXtopo].vw=[[UIImageView alloc] initWithImage:img]; [master.view addSubview:IMG[NDXtopo].vw]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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