DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Fri, 27 Jul 2007 02:00:05 -0700,    posted on: microsoft.public.dotnet.framework.drawing        back       

Thread Index
  1    ohs
          2    Michael C


Addative / Subtractive Painting of a Region   
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.


Any ideas ?
Date:Fri, 27 Jul 2007 02:00:05 -0700   Author:  

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:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us