How to create empty transparent png in Objective-C?

How can I create an empty png UIImage in Objective-C programmatically (say 36x36 px)?

Thank:)

+47
ios objective-c uiimage
Sep 02 '12 at 11:25
source share
1 answer

You can open the context of the image and then immediately collect its contents without contributing anything to it. This should result in a 36x36 36x36 UIImage :

 UIGraphicsBeginImageContextWithOptions(CGSizeMake(36, 36), NO, 0.0); UIImage *blank = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); 
+94
Sep 02
source share



All Articles