That should give you this idea. However, this code may need tweaking or two. (I admit that I did not run it.)
Your base level of UIImageView can be displayed in the context of a CoreGraphics bitmap (this, of course, will include all sublayers), which can then provide you with a new UIImage .
UIImage *finalImage;
All of these functions are described in the UIKit Feature Reference .
There is also a slightly more complicated way that gives you more control over things like color, which involves creating a CGBitmapContext and getting a CGImageRef from which you can create a UIImage again. This is described in the Quartz 2D Programming Guide, section βCreating a Graphic Raster Image Contextβ .
source share