How to erase line from image (for example CIImage or NSImage or bitmap) by painting it? Just like eraser. I wonder how to do that with Core Graphics?
Asked
Active
Viewed 863 times
1 Answers
1
This is definitely a dupe (I even answered the dupe!) but I cant find it at the moment due to the phone searching being a little fiddly. So, apologies for that, here is the gist of the other answer:
You can do this, assuming your lines are drawn on a separate, equally sized view on top of the image view, by setting the drawing colour to colorWithPatternImage:
, using the image view image. Lines drawn with this colour "erase" whatever was previously on the view by effectively drawing small sections of the underlying image on top of your existing drawn lines.

jrturton
- 118,105
- 32
- 252
- 268
-
Hmm.. one question, when I am drawing with big image (for example: 3000x2000px) it makes lag. Maybe You know how to avoid this? – Justin Boo Dec 04 '11 at 12:01
-
Don't know, sorry. That is a big image to be handling on the phone! You should ask a new question. – jrturton Dec 04 '11 at 12:33