I'm trying to create randomly generated images for a class I'm writing in objective-c, and was just hoping to get a little clarification as to different image properties and types. I want to create the following function:
-(UIImage*)randomlyGenerateAnImage;
This function will use member data to create a quasi-random algorithmically generated UIImage.
I'm really having trouble understanding the relation between UIImages, CGRects, and CGContextRefs. Which is the one I draw on and what do I assign to the UIImage.
Edit I'm trying to generate my image on the fly, something like:
UIImage * newImage = [[UIImage alloc] "initBlankImageWithSize(X, Y)"];
CGContextRef * newContext = "getContextFromImage(newImage)";
"draw on newContext......";
return newImage;