transparent textures from gdo

Staeff

New member
Joined
Jan 22, 2004
Messages
4
transparent textures from gdi

Hello,
Im trying to use the alpha channel of a gdi bitmap, but it isnt 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 didnt 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 by a moderator:

Similar threads

C
Replies
0
Views
142
CompuTechSide
C
M
Replies
0
Views
105
Madhan kumarasamy
M
Back
Top