Re: Windows forms with Transparent Backgrounds
- From: "Alberto Poblacion" <earthling-quitaestoparacontestar@xxxxxxxxxxxxx>
- Date: Tue, 24 Apr 2007 22:35:33 +0200
"Eric Renken" <EricRenken@xxxxxxxxxxxxxxxx> wrote in message news:Oz3P92qhHHA.5044@xxxxxxxxxxxxxxxxxxxxxxx
The work around at http://support.microsoft.com/default.aspx?scid=kb;en-us;822495 doesn't work. When I do this I end up seeing the background color for the form, and you can't set the Background Color of a form to transparent if you do you get a nice runtime error.
I'm going to say a silly thing, but the above-mentioned workaround takes the transparencykey color from the pixel at (10,10) in the bitmap. Have you verified that the color that you are taking is *really* the color that you chose as transparent?
If you are only doing this to get a non-rectangular form, there's an alternative aproach that works at all color depths:
1. Override the OnPaint event of the form.
2. In OnPaint, create a new instance of the GraphicsPath class.
3. Use the methods of the GraphicsPath object, such as AddEllipse, to specify the shape and size required for the form.
4. Set the Region property of the form to a new Region, passing in the constructor the GraphicsPath object that you have just created.
.
- Follow-Ups:
- Re: Windows forms with Transparent Backgrounds
- From: Eric Renken
- Re: Windows forms with Transparent Backgrounds
- References:
- Windows forms with Transparent Backgrounds
- From: Eric Renken
- Re: Windows forms with Transparent Backgrounds
- From: Alberto Poblacion
- Re: Windows forms with Transparent Backgrounds
- From: Eric Renken
- Windows forms with Transparent Backgrounds
- Prev by Date: Re: GC.Collect can be trusted?
- Next by Date: Point to array in Csharp and native dll
- Previous by thread: Re: Windows forms with Transparent Backgrounds
- Next by thread: Re: Windows forms with Transparent Backgrounds
- Index(es):
Relevant Pages
|