Staeff Posted December 23, 2005 Posted December 23, 2005 (edited) 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? 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: dev.RenderState.AlphaBlendEnable = true; dev.RenderState.SourceBlend = Blend.SourceAlpha; dev.RenderState.DestinationBlend = Blend.InvSourceAlpha; Edited December 23, 2005 by Staeff Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.