transparent textures from gdo

Staeff

Newcomer
Joined
Jan 22, 2004
Messages
4
transparent textures from gdi

Hello,
I'm trying to use the alpha channel of a gdi bitmap, but it isn't working..
does anyone know how to do it?
Code:
Bild = new Bitmap(200, 200, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(Bild);

//those lines also didn't work
//   SolidBrush bop = new SolidBrush(Color.Green);
// g.FillRectangle(bop, 0, 0, 200, 200);
// Bild.MakeTransparent(Color.Green);

Font f = new Font("Verdana", 30);
SolidBrush b = new SolidBrush(Color.FromArgb(255, 255, 0, 0));
g.DrawString("Just one line!", f, b, 5, 40);                                        
ReadyTexture3 = Texture.FromBitmap( device, Bild, 0, Pool.Managed);

Renderstates:
Code:
dev.RenderState.AlphaBlendEnable = true;
dev.RenderState.SourceBlend = Blend.SourceAlpha;
dev.RenderState.DestinationBlend = Blend.InvSourceAlpha;
 
Last edited:
Back
Top