Use UIGraphicsBeginImageContext() , draw it, then use UIGraphicsGetImageFromCurrentImageContext() . Remember to then add the UIGraphicsEndImageContext() context.
You should avoid creating an extra image if you just want to display two images on the screen, due to the limited memory available on the device. Instead, display them using the appropriate drawInRect: calls to avoid copying.
source share