Shaped Windows Forms

G

Guest

I have an picture cut out in a certain shape that I would like to make as my form. I have tried following the directions in MSDN on how to make shaped windows forms but their directions did not work for me. Does anyone know how I can set my irregular shaped picture as my form?

Thanks for the help.
 
B

Bob Powell [MVP]

The GDI+ FAQ demonstrates a way to get a region from a bitmap. This region
can then be used to create a shaped form.

--
Bob Powell [MVP]
Visual C#, System.Drawing

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml






James said:
I have an picture cut out in a certain shape that I would like to make as
my form. I have tried following the directions in MSDN on how to make
shaped windows forms but their directions did not work for me. Does anyone
know how I can set my irregular shaped picture as my form?
 
G

Guest

Thanks very much for the help. The code provided on your site for the GetRegion method worked. I just have a question regarding that. Is it possible to put that method into a dll file cause I tried it and couldn't? It requires the namespace System.Drawing since it uses Bitmap objects and class libraries don't support the namespace.

Thanks again.
 
B

Bob Powell [MVP]

Just include System.Drawing as a reference in you DLL project...

--
Bob Powell [MVP]
Visual C#, System.Drawing

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml






James said:
Thanks very much for the help. The code provided on your site for the
GetRegion method worked. I just have a question regarding that. Is it
possible to put that method into a dll file cause I tried it and couldn't?
It requires the namespace System.Drawing since it uses Bitmap objects and
class libraries don't support the namespace.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top