Dear Colleagues!

It is impossible to create something by default (not to get from somewhere, namely to create).

You need to create a UIImage object (as a variant of a CGImage ) with dimensions of 288 * 352 pixels.

Question: how to do it?

    1 answer 1

    Well, like this: (creates an image of the right size and fills it with gray)

     UIGraphicsBeginImageContext(CGSizeMake(288, 352)); CGRect drawRect = CGRectMake(0,0,288,352); CGContextSetRGBFillColor(UIGraphicsGetCurrentContext(), 100.0f/255.0f, 100.0f/255.0f, 100.0f/255.0f, 1.0f); CGContextFillRect(UIGraphicsGetCurrentContext(), drawRect); UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); // вот ваше изображение UIGraphicsEndImageContext(); 
    • Thank you, This is what I need and what I was soooooooooooo much. You are very similar to a specialist judging by the answer. Can you still have a simple question for you personally? I have a feeling that many commands related to image processing (the uiimage and cgimageref classes) eat a lot of memory, and the image instance (be it a UIImage or CGImageRef class) doesn’t "kill" with the line image = nil . I'm right? How, then, to properly destroy the object of these classes? - Andrew Kachalin
    • create a new question. - Max Mikheyenko