views:

35

answers:

2

I'm planning to allow user drawing shapes and lines on image using mouse. If the background is solid, it's quite easy to build the eraser tool (simply fill with background color). But how to make it with image as background?

+2  A: 

You have to maintain a layers structure. What the user will see will be a "preview" of the output. You'll merge the layers when you export the image to a format than do not support layers.

Pierre 303
+2  A: 

Not quite sure I follow. But if you want erase something that was drawn on top of an image then you can erase by drawing the image back. That's easy to do if you use the TextureBrush class. I think you need the TextureBrush(Image, Rectangle) overload to create it. Pass the background image as the first argument, the bounding rectangle of that image as the second argument.

Hans Passant
Many ThanksThat's what I was looking for...
Sphynx