Author |
Message |
Mr. Mago #1 / 7
|
 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 |
|
 |
ClayB [Syncfusion #2 / 7
|
 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 |
|
 |
Mr. Mago #3 / 7
|
 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 |
|
 |
Mr. Mago #4 / 7
|
 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 |
|
 |
Erik Brow #5 / 7
|
 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 |
|
 |
Mr. Mago #6 / 7
|
 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 |
|
 |
Ryan Dawso #7 / 7
|
 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 |
|
|
|