I am creating an app like whiteboard application. I have one dynamic image. Image has multiple colors. I want to draw line on that Image same as whiteboard so I had overlap
You can use blend mode. Use CGBlendMode..Clear Document
If you have an image in the background, and the image is the same size and origin as your whiteboard drawing canvas, you could try drawing your "erase" lines using the background image as a colour pattern:
[[UIColor colorWithPatternImage:backgroundImage] set];
Where backgroundImage
is the UIImage
that you are drawing on top of.
This will overpaint your drawn lines with the image underneath, so it will appear that they are erased. It seems a bit hacky, though?