Re: Addative / Subtractive Painting of a Region
"ohs" wrote in message
news:F9706CAB-E4DF-4CBE-AC8B-2B092EEB35B2@microsoft.com...
> I'd like to allow users to paint over an image using a circle of a given
> size
> so that I can 'cut' out the painted area.
>
> I've tried using graphicspath.addellipse on mouse move which gives an
> impression of what I require but this leaves the interior of the path all
> jumbled with circles.
>
> I'd also like to be able to unpaint areas (subtractive) and have a feeling
> the way forward is with Regions but have no idea where to start.
I can see 2 methods, the first is regions and the second is with a 2 color
bitmap that you can use with a mask.
For regions you just need to create a region object and then for each circle
you would create a circular region and then union them. I'm not sure how
regions work internally so I'm not sure if this would create a large
overhead if there were a large number of circles.
For the mask bitmap just create a 2 color bitmap of the same size as your
main bitmap and fill in any pixels as you circle moves. Then use this as a
mask when drawing. If you're still here let me know and I can provide some
extra details (I haven't thought that far ahead yet :-).
Michael
Date:Tue, 31 Jul 2007 12:08:57 +1000
Author:
|