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: Mon, 9 Jul 2007 14:18:50 +0100,    posted on: microsoft.public.dotnet.framework.drawing        back       

Thread Index
  1    Mark
          2    Michael C
          3    Mark
                 4    Michael C
                        5    Mark
                 6    Mark
                 7    ohs


Clip image based on emf metafile   
Hi,

I'm trying to clip an image to an irregular shape.  I've come across some 
advice from Bob Powell 
(http://groups.google.co.uk/group/microsoft.public.dotnet.framework.drawing/browse_thread/thread/86485270f7a57ede/dd79ef1988191326?lnk=st&q=cropping+or+extracting+ellipse+from+image&rnum=1&hl=en#dd79ef1988191326) 
that works nicely, but I'd like to replace the ellipse with a shape based on 
an emf file for the clip region.

Can anyone point me in the right direction?

Thanks

Mark
Date:Mon, 9 Jul 2007 14:18:50 +0100   Author:  

Re: Clip image based on emf metafile   
"Mark"  wrote in message 
news:u%23RDgviwHHA.484@TK2MSFTNGP06.phx.gbl...

> Hi,
>
> I'm trying to clip an image to an irregular shape.  I've come across some 
> advice from Bob Powell 
> (http://groups.google.co.uk/group/microsoft.public.dotnet.framework.drawing/browse_thread/thread/86485270f7a57ede/dd79ef1988191326?lnk=st&q=cropping+or+extracting+ellipse+from+image&rnum=1&hl=en#dd79ef1988191326) 
> that works nicely, but I'd like to replace the ellipse with a shape based 
> on an emf file for the clip region.
>
> Can anyone point me in the right direction?


I'm not sure if this is the ideal solution but you could draw the emf file 
to a bitmap and use that as a mask.



>
> Thanks
>
> Mark 
Date:Tue, 10 Jul 2007 10:43:34 +1000   Author:  

Re: Clip image based on emf metafile   
Thanks for your reply Michael.  Why not ideal?  Unfortunately I'm stuck with 
having to use emf files.  My assumption was that as Bob Powell's solution 
used a GraphicsPath I could get the same from an emf file?

Could you give any more details on your idea as I'm quite new at this?

Thanks again.

Mark

"Michael C"  wrote in message 
news:OQ$7otowHHA.4628@TK2MSFTNGP02.phx.gbl...

> "Mark"  wrote in message 
> news:u%23RDgviwHHA.484@TK2MSFTNGP06.phx.gbl...
>> Hi,
>>
>> I'm trying to clip an image to an irregular shape.  I've come across some 
>> advice from Bob Powell 
>> (http://groups.google.co.uk/group/microsoft.public.dotnet.framework.drawing/browse_thread/thread/86485270f7a57ede/dd79ef1988191326?lnk=st&q=cropping+or+extracting+ellipse+from+image&rnum=1&hl=en#dd79ef1988191326) 
>> that works nicely, but I'd like to replace the ellipse with a shape based 
>> on an emf file for the clip region.
>>
>> Can anyone point me in the right direction?
>
> I'm not sure if this is the ideal solution but you could draw the emf file 
> to a bitmap and use that as a mask.
>
>
>>
>> Thanks
>>
>> Mark
>
> 
Date:Tue, 10 Jul 2007 07:58:31 +0100   Author:  

Re: Clip image based on emf metafile   
"Mark"  wrote in message 
news:ujBR9%23rwHHA.4736@TK2MSFTNGP04.phx.gbl...

> Thanks for your reply Michael.  Why not ideal?


When I say not ideal I mean there might be a better method that I don't know 
about, such as converting an emf to a path. Then again my idea might be the 
only option seeing there have been no other replies.


> Unfortunately I'm stuck with having to use emf files.  My assumption was 
> that as Bob Powell's solution used a GraphicsPath I could get the same 
> from an emf file?
>
> Could you give any more details on your idea as I'm quite new at this?


Assuming you start with a bitmap of 100x100 and want to set some areas to 
transparent based on an emf file (correct me if I'm wrong) try something 
like this:
Create a second bitmap of 100x100
Draw the emf to the second bitmap
Use LockBits to iterate through every pixel of both bitmaps (look up help on 
lock bits or search bob's website)
Set pixels to transparent in the initial bitmap based on the second bitmap.

That's probably not enough detail again but give it a go and have a look at 
LockBits and get back to me with any questions.

Michael
Date:Wed, 11 Jul 2007 10:30:38 +1000   Author:  

Re: Clip image based on emf metafile   
Hi Michael,

I see what you mean.  That seems a good idea and I'll give it a go.

Thanks very much for the extra details.

Mark

"Michael C"  wrote in message 
news:ecYo$K1wHHA.4628@TK2MSFTNGP02.phx.gbl...

> "Mark"  wrote in message 
> news:ujBR9%23rwHHA.4736@TK2MSFTNGP04.phx.gbl...
>> Thanks for your reply Michael.  Why not ideal?
>
> When I say not ideal I mean there might be a better method that I don't 
> know about, such as converting an emf to a path. Then again my idea might 
> be the only option seeing there have been no other replies.
>
>> Unfortunately I'm stuck with having to use emf files.  My assumption was 
>> that as Bob Powell's solution used a GraphicsPath I could get the same 
>> from an emf file?
>>
>> Could you give any more details on your idea as I'm quite new at this?
>
> Assuming you start with a bitmap of 100x100 and want to set some areas to 
> transparent based on an emf file (correct me if I'm wrong) try something 
> like this:
> Create a second bitmap of 100x100
> Draw the emf to the second bitmap
> Use LockBits to iterate through every pixel of both bitmaps (look up help 
> on lock bits or search bob's website)
> Set pixels to transparent in the initial bitmap based on the second 
> bitmap.
>
> That's probably not enough detail again but give it a go and have a look 
> at LockBits and get back to me with any questions.
>
> Michael
> 
Date:Wed, 11 Jul 2007 18:31:17 +0100   Author:  

Re: Clip image based on emf metafile   
Hi Mark

Did you get anywhere with your graphicpath clipping ?

I'm trying to 'cut out' an area of an image using a graphics path so that I 
can assign the clipped image to a button.


I posted here on 7/16/07 but no takers.

"Mark" wrote:


> Hi Michael,
> 
> I see what you mean.  That seems a good idea and I'll give it a go.
> 
> Thanks very much for the extra details.
> 
> Mark
> 
> "Michael C"  wrote in message 
> news:ecYo$K1wHHA.4628@TK2MSFTNGP02.phx.gbl...
> > "Mark"  wrote in message 
> > news:ujBR9%23rwHHA.4736@TK2MSFTNGP04.phx.gbl...
> >> Thanks for your reply Michael.  Why not ideal?
> >
> > When I say not ideal I mean there might be a better method that I don't 
> > know about, such as converting an emf to a path. Then again my idea might 
> > be the only option seeing there have been no other replies.
> >
> >> Unfortunately I'm stuck with having to use emf files.  My assumption was 
> >> that as Bob Powell's solution used a GraphicsPath I could get the same 
> >> from an emf file?
> >>
> >> Could you give any more details on your idea as I'm quite new at this?
> >
> > Assuming you start with a bitmap of 100x100 and want to set some areas to 
> > transparent based on an emf file (correct me if I'm wrong) try something 
> > like this:
> > Create a second bitmap of 100x100
> > Draw the emf to the second bitmap
> > Use LockBits to iterate through every pixel of both bitmaps (look up help 
> > on lock bits or search bob's website)
> > Set pixels to transparent in the initial bitmap based on the second 
> > bitmap.
> >
> > That's probably not enough detail again but give it a go and have a look 
> > at LockBits and get back to me with any questions.
> >
> > Michael
> > 
> 
> 
Date:Thu, 19 Jul 2007 22:12:14 -0700   Author:  

Re: Clip image based on emf metafile   
Not yet I'm afraid.

Will post back when I make progress.

Mark


"ohs"  wrote in message 
news:6D5DB01E-341B-4C72-B10A-44259D60FCA2@microsoft.com...

> Hi Mark
>
> Did you get anywhere with your graphicpath clipping ?
>
> I'm trying to 'cut out' an area of an image using a graphics path so that 
> I
> can assign the clipped image to a button.
>
>
> I posted here on 7/16/07 but no takers.
>
> "Mark" wrote:
>
>> Hi Michael,
>>
>> I see what you mean.  That seems a good idea and I'll give it a go.
>>
>> Thanks very much for the extra details.
>>
>> Mark
>>
>> "Michael C"  wrote in message
>> news:ecYo$K1wHHA.4628@TK2MSFTNGP02.phx.gbl...
>> > "Mark"  wrote in message
>> > news:ujBR9%23rwHHA.4736@TK2MSFTNGP04.phx.gbl...
>> >> Thanks for your reply Michael.  Why not ideal?
>> >
>> > When I say not ideal I mean there might be a better method that I don't
>> > know about, such as converting an emf to a path. Then again my idea 
>> > might
>> > be the only option seeing there have been no other replies.
>> >
>> >> Unfortunately I'm stuck with having to use emf files.  My assumption 
>> >> was
>> >> that as Bob Powell's solution used a GraphicsPath I could get the same
>> >> from an emf file?
>> >>
>> >> Could you give any more details on your idea as I'm quite new at this?
>> >
>> > Assuming you start with a bitmap of 100x100 and want to set some areas 
>> > to
>> > transparent based on an emf file (correct me if I'm wrong) try 
>> > something
>> > like this:
>> > Create a second bitmap of 100x100
>> > Draw the emf to the second bitmap
>> > Use LockBits to iterate through every pixel of both bitmaps (look up 
>> > help
>> > on lock bits or search bob's website)
>> > Set pixels to transparent in the initial bitmap based on the second
>> > bitmap.
>> >
>> > That's probably not enough detail again but give it a go and have a 
>> > look
>> > at LockBits and get back to me with any questions.
>> >
>> > Michael
>> >
>>
>> 
Date:Thu, 26 Jul 2007 11:04:12 +0100   Author:  

Google
 
Web dotnetnewsgroup.com


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