iphone - Memory Map UIImage -


I have a UIImage and I would like to put my data into a file and after that A map file is obviously used to save some memory, UIImage data is private and it is not possible to access it.

Thanks

If you want to map the encoded image data to the memory For then, make a file mmap and pass a CGDTROVRR to CGIMAZERF and provide a reference of the data.

  map = MMAP (zero, length, ...); Provider = CGDTProviratoratrate data (Map, Map, Length, Mppa); Image = CMIM image creator (..., provider, ...); Uiimage = [UIImage imageWithCGImage: image]; ...  

Where munmap_wrapper does something like this:

  // corresponds to CGDTproper. Re: DataDialback Invalid Mismod_User (Zero * P, Constant blank * CP, Size_TL) {Mump (P, L); }  

If you want memory, instead of encoded source data, map the actual pixels, then you will do something like this with CGBitmapContext. You will also create the provider and the image, so that the image references pixels similar to the context. Anything that has been drawn in the context will be the contents of the image. Width, height, color space, and other parameters should be similar to the reference and image.

  context = CGBitmapContextCreate (map, ...);  

In this case, the length should be at least bytes_for_urrow * height bytes so that the file should be at least large.

If you have an existing image and you want to mmap the pixels, then create a bitmap context with the size and color space of your image and use CGContextDrawImage to draw the image in the context.

You did not say the source of your image, but if you are making it on the runtime it will be more efficient to make it directly in the bitmap context. Any image creation requires a bitmap reference behind the scenes , So this memory map has been started from one.


Comments