I have one UIImage *backgroundImage = [[UIImage alloc] initWithData:imgData];
I will draw an image on top of this image with:
CGSize finalSize = [backgroundImage size];
UIImage *newImage; UIGraphicsBeginImageContext(finalSize);
newImage = backgroundImage;
[newImage drawInRect:CGRectMake(0,0,finalSize.width,finalSize.height)];
UIImage *imageItem = [[UIImage alloc] initWithData:itemImgData];
[imageItem drawInRect:CGRectMake(10,10,100,100)];
newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Is there any way I can have reference to imageItem that is drawn on top of backgroundImage so that I can set it's visibility, either visible/invisible after the imageItem is drawn? Let's say the reference to imageItem is imageItemRef, I want to set it's visibility based on certain condition:
if(shouldVisible){
[imageItemRef setHidden:TRUE];
else
[imageItemRef setHidden:FALSE];
The reason I am not using another view to represent item that's on top of the backgroundImage is because i am implementing zooming on the backgroundImage and I want item to be zoomed as well when backgroundImage is zoomed.