views:

37

answers:

1

I am looking to create an Eraser for a drawing app in Canvas, and I have this code

canvas.clearRect(x, y, width, height);

How would i implement it?

+2  A: 

How do you really want the eraser? You could just paint with the background color instead of the foreground color.

You should probably let the user chose the foreground and background colors.

Jonas
Yes that is how I want it.
Henry D'Andrea
Then you do it exact as you implementing your drawing, but use the "background color" instead. You should probably let the user choose a background color.
Jonas