transparent bitmap 
Author Message
 transparent bitmap

how do you make all of the black pixels in a bitmap
transparent when you display it in GDI+


Thu, 24 Feb 2005 08:13:54 GMT  
 transparent bitmap
Try calling the MakeTransparent member of your bitmap passing Color.Black as
its argument.

==================
Clay Burch

Syncfusion, Inc.
Visit www.syncfusion.com to download a free trial of Essential Suite


Quote:
> how do you make all of the black pixels in a bitmap
> transparent when you display it in GDI+



Thu, 24 Feb 2005 08:50:49 GMT  
 transparent bitmap
how do I use MakeTransparent? it isnt comming up on
intellisense. This is the bitmap im displaying:

Image antsImage;
antsImage = new Bitmap("ants.bmp");
Brush ants = new TextureBrush(antsImage, new Rectangle
(0,0,256,256));
backBuffer.FillRectangle(ants,200,200,256,256);

Quote:
>-----Original Message-----
>Try calling the MakeTransparent member of your bitmap

passing Color.Black as
Quote:
>its argument.

>==================
>Clay Burch

>Syncfusion, Inc.
>Visit www.syncfusion.com to download a free trial of
Essential Suite



>> how do you make all of the black pixels in a bitmap
>> transparent when you display it in GDI+

>.



Thu, 24 Feb 2005 09:41:56 GMT  
 transparent bitmap
when I try it like this:

Image antsImage;
antsImage = new Bitmap("ants.bmp");
Brush ants = new TextureBrush(antsImage, new Rectangle
(0,0,256,256));
antsImage.MakeTransparent(Color.Black);
backBuffer.FillRectangle(ants,200,200,256,256);

I get this error:

C:\2501\2501\Form1.cs(61): 'System.Drawing.Image' does
not contain a definition for 'MakeTransparent'

What should I do?

Quote:
>-----Original Message-----
>Try calling the MakeTransparent member of your bitmap

passing Color.Black as
Quote:
>its argument.

>==================
>Clay Burch

>Syncfusion, Inc.
>Visit www.syncfusion.com to download a free trial of
Essential Suite



>> how do you make all of the black pixels in a bitmap
>> transparent when you display it in GDI+

>.



Thu, 24 Feb 2005 09:51:18 GMT  
 transparent bitmap
Try changing you "antsImage" variable to be a Bitmap class instance rather
than an Image.

Bitmap antsImage;
antsImage = new Bitmap("ants.bmp");
Brush ants = new TextureBrush(antsImage, new Rectangle(0,0,256,256));
antsImage.MakeTransparent(Color.Black);

============
Erik Brown
Author of "Windows Forms Programming with C#"
http://www.amazon.com/exec/obidos/ASIN/1930110286


Quote:
> when I try it like this:

> Image antsImage;
> antsImage = new Bitmap("ants.bmp");
> Brush ants = new TextureBrush(antsImage, new Rectangle
> (0,0,256,256));
> antsImage.MakeTransparent(Color.Black);
> backBuffer.FillRectangle(ants,200,200,256,256);

> I get this error:

> C:\2501\2501\Form1.cs(61): 'System.Drawing.Image' does
> not contain a definition for 'MakeTransparent'

> What should I do?

> >-----Original Message-----
> >Try calling the MakeTransparent member of your bitmap
> passing Color.Black as
> >its argument.

> >==================
> >Clay Burch

> >Syncfusion, Inc.
> >Visit www.syncfusion.com to download a free trial of
> Essential Suite



> >> how do you make all of the black pixels in a bitmap
> >> transparent when you display it in GDI+

> >.



Thu, 24 Feb 2005 12:21:43 GMT  
 transparent bitmap
that fixed it, thanks

Quote:
>-----Original Message-----
>Try changing you "antsImage" variable to be a Bitmap

class instance rather
Quote:
>than an Image.

>Bitmap antsImage;
>antsImage = new Bitmap("ants.bmp");
>Brush ants = new TextureBrush(antsImage, new Rectangle
(0,0,256,256));
>antsImage.MakeTransparent(Color.Black);

>============
>Erik Brown
>Author of "Windows Forms Programming with C#"
>http://www.amazon.com/exec/obidos/ASIN/1930110286



>> when I try it like this:

>> Image antsImage;
>> antsImage = new Bitmap("ants.bmp");
>> Brush ants = new TextureBrush(antsImage, new Rectangle
>> (0,0,256,256));
>> antsImage.MakeTransparent(Color.Black);
>> backBuffer.FillRectangle(ants,200,200,256,256);

>> I get this error:

>> C:\2501\2501\Form1.cs(61): 'System.Drawing.Image' does
>> not contain a definition for 'MakeTransparent'

>> What should I do?

>> >-----Original Message-----
>> >Try calling the MakeTransparent member of your bitmap
>> passing Color.Black as
>> >its argument.

>> >==================
>> >Clay Burch

>> >Syncfusion, Inc.
>> >Visit www.syncfusion.com to download a free trial of
>> Essential Suite



>> >> how do you make all of the black pixels in a bitmap
>> >> transparent when you display it in GDI+

>> >.

>.



Thu, 24 Feb 2005 13:15:11 GMT  
 transparent bitmap
Mr. Magoo,

Just for reference, you can always change your brush to have a selected
alpha value:
SolidBrush semiTransBrush = new SolidBrush(Color.FromArgb(100, 0, 50, 255));

--

Hope this Helps.

Ryan Dawson


Quote:
> that fixed it, thanks

> >-----Original Message-----
> >Try changing you "antsImage" variable to be a Bitmap
> class instance rather
> >than an Image.

> >Bitmap antsImage;
> >antsImage = new Bitmap("ants.bmp");
> >Brush ants = new TextureBrush(antsImage, new Rectangle
> (0,0,256,256));
> >antsImage.MakeTransparent(Color.Black);

> >============
> >Erik Brown
> >Author of "Windows Forms Programming with C#"
> >http://www.amazon.com/exec/obidos/ASIN/1930110286



> >> when I try it like this:

> >> Image antsImage;
> >> antsImage = new Bitmap("ants.bmp");
> >> Brush ants = new TextureBrush(antsImage, new Rectangle
> >> (0,0,256,256));
> >> antsImage.MakeTransparent(Color.Black);
> >> backBuffer.FillRectangle(ants,200,200,256,256);

> >> I get this error:

> >> C:\2501\2501\Form1.cs(61): 'System.Drawing.Image' does
> >> not contain a definition for 'MakeTransparent'

> >> What should I do?

> >> >-----Original Message-----
> >> >Try calling the MakeTransparent member of your bitmap
> >> passing Color.Black as
> >> >its argument.

> >> >==================
> >> >Clay Burch

> >> >Syncfusion, Inc.
> >> >Visit www.syncfusion.com to download a free trial of
> >> Essential Suite



> >> >> how do you make all of the black pixels in a bitmap
> >> >> transparent when you display it in GDI+

> >> >.

> >.



Fri, 25 Feb 2005 00:17:51 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. transparent bitmap on toolbar button

2. Transparent Bitmap

3. Transparent Bitmap

4. Transparent Bitmap Paste?

5. How to implement TRANSPARENT Bitmap Buttons

6. None transparent bitmap

7. Transparent Bitmap Problem

8. How to draw transparent bitmap?

9. How to use BitBlt to draw a transparent bitmap

10. How to display Transparent Bitmap Button?

11. resource editor - CStatic - TRANSPARENT - bitmap

12. Transparent Bitmap

 

 
Powered by phpBB® Forum Software