PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms help with windows transparency

Reply

help with windows transparency

 
Thread Tools Rate Thread
Old 12-12-2005, 06:50 PM   #1
=?Utf-8?B?anQgaGFya2V5?=
Guest
 
Posts: n/a
Default help with windows transparency


hello, i am trying to create a form with the shape of a bitmap, like media
player can do. i know that there is a bug with the TransparencyKey property
and 32bpp mode. so i tried the workaround provided on msdn but it doesnt
work. could someone please tell me what im doing wrong? i am using windows
xp. here is my code.

Bitmap bmp = new Bitmap("Body.bmp");
bmp.MakeTransparent(bmp.GetPixel(0, 0));
BackgroundImage = bmp;
this.TransparencyKey = bmp.GetPixel(0, 0);

now this does make the proper color transparent (which is at 0,0 on the
bitmap), but it also makes pure black (RGB(0,0,0). why would it do this?

thanks in advance.

  Reply With Quote
Old 12-12-2005, 06:56 PM   #2
=?Utf-8?B?anQgaGFya2V5?=
Guest
 
Posts: n/a
Default RE: help with windows transparency

i forgot to mention. the transparent color at 0,0 is bright yellow, so thats
not why the black is transparent too.

"jt harkey" wrote:

> hello, i am trying to create a form with the shape of a bitmap, like media
> player can do. i know that there is a bug with the TransparencyKey property
> and 32bpp mode. so i tried the workaround provided on msdn but it doesnt
> work. could someone please tell me what im doing wrong? i am using windows
> xp. here is my code.
>
> Bitmap bmp = new Bitmap("Body.bmp");
> bmp.MakeTransparent(bmp.GetPixel(0, 0));
> BackgroundImage = bmp;
> this.TransparencyKey = bmp.GetPixel(0, 0);
>
> now this does make the proper color transparent (which is at 0,0 on the
> bitmap), but it also makes pure black (RGB(0,0,0). why would it do this?
>
> thanks in advance.
>

  Reply With Quote
Old 15-12-2005, 08:28 PM   #3
=?Utf-8?B?anQgaGFya2V5?=
Guest
 
Posts: n/a
Default RE: help with windows transparency

ugh, i still cant get it. i cant figure this out. does anyone have any idea?
no matter what the pure black is always transparent and it shouldnt be.

"jt harkey" wrote:

> hello, i am trying to create a form with the shape of a bitmap, like media
> player can do. i know that there is a bug with the TransparencyKey property
> and 32bpp mode. so i tried the workaround provided on msdn but it doesnt
> work. could someone please tell me what im doing wrong? i am using windows
> xp. here is my code.
>
> Bitmap bmp = new Bitmap("Body.bmp");
> bmp.MakeTransparent(bmp.GetPixel(0, 0));
> BackgroundImage = bmp;
> this.TransparencyKey = bmp.GetPixel(0, 0);
>
> now this does make the proper color transparent (which is at 0,0 on the
> bitmap), but it also makes pure black (RGB(0,0,0). why would it do this?
>
> thanks in advance.
>

  Reply With Quote
Old 16-12-2005, 11:10 PM   #4
Peter Oliphant
Guest
 
Posts: n/a
Default Re: help with windows transparency

Have you seen this bug report? It looks like it's related:

http://lab.msdn.microsoft.com/produ...9f-b246dabaeef0

The bad news is that this bug was reported in July, and MS has responded
that they know it's a real bug, but they don't consider it an important
enough bug to fix at this time. And that was 5 months ago...

[==P==]

"jt harkey" <jtharkey@discussions.microsoft.com> wrote in message
news9191143-8473-4D42-B13E-695D61A4CD20@microsoft.com...
> ugh, i still cant get it. i cant figure this out. does anyone have any
> idea?
> no matter what the pure black is always transparent and it shouldnt be.
>
> "jt harkey" wrote:
>
>> hello, i am trying to create a form with the shape of a bitmap, like
>> media
>> player can do. i know that there is a bug with the TransparencyKey
>> property
>> and 32bpp mode. so i tried the workaround provided on msdn but it doesnt
>> work. could someone please tell me what im doing wrong? i am using
>> windows
>> xp. here is my code.
>>
>> Bitmap bmp = new Bitmap("Body.bmp");
>> bmp.MakeTransparent(bmp.GetPixel(0, 0));
>> BackgroundImage = bmp;
>> this.TransparencyKey = bmp.GetPixel(0, 0);
>>
>> now this does make the proper color transparent (which is at 0,0 on the
>> bitmap), but it also makes pure black (RGB(0,0,0). why would it do this?
>>
>> thanks in advance.
>>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off