Erase when drawing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Erase when drawing

jrick
Hi,

I'm building a drawing application for the iPad and I'm having some problems building erase into it. I'm using fillOval:fillStyle: and drawPolygon:fillStyle: for drawing normally and I'd like to use the same methods for erasing. Unfortunately, when I put in (Color transparent) as the fillStyle, it doesn't do anything. I believe this is because it is acting as a paint over combination rule. So, original + transparent = original. What I want is that the transparent color takes the place of the original color. Any advice on how to do this?

Thanks,

Jeff

--
Jochen "Jeff" Rick, Ph.D.
http://www.je77.com/
+44(0)1908 332 451 (work)
Skype ID: jochenrick


Reply | Threaded
Open this post in threaded view
|

Re: Erase when drawing

Ricardo Moran
Hi, I don't know if this will help you but I started working on a drawing app for Etoys and I'm using a Pen for the paintbrush. This way I can change its sourceForm and use different shapes and stuff. And when I need to erase I simply change its combination rule to #erase1bitShape, otherwise I use the #paint combination rule and I change the pen's color to whatever color I want.
Maybe this is not the right way of doing it but it works :)

Richo

On Wed, Aug 18, 2010 at 4:15 PM, J.F. Rick <[hidden email]> wrote:
Hi,

I'm building a drawing application for the iPad and I'm having some problems building erase into it. I'm using fillOval:fillStyle: and drawPolygon:fillStyle: for drawing normally and I'd like to use the same methods for erasing. Unfortunately, when I put in (Color transparent) as the fillStyle, it doesn't do anything. I believe this is because it is acting as a paint over combination rule. So, original + transparent = original. What I want is that the transparent color takes the place of the original color. Any advice on how to do this?

Thanks,

Jeff

--
Jochen "Jeff" Rick, Ph.D.
http://www.je77.com/
+44(0)1908 332 451 (work)
Skype ID: jochenrick