This topic is now archived and is closed to further replies.

Transpaent surface values

This topic is 5149 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is managed direct draw I created a bmp within the ide so I''m using white as the transparent color. I did this code but it doesnt hid the value. It does hide the white but turns it blue which i believe is the default surface color. Please help me define the surface transparency. SurfaceDescription desc = new SurfaceDescription(); SurfaceCaps caps = new SurfaceCaps(); localClipper = new Clipper(localDevice); localClipper.Window = owner; desc.SurfaceCaps.PrimarySurface = true; surfacePrimary = new Surface(desc, localDevice); surfacePrimary.Clipper = localClipper; desc.Clear(); desc.SurfaceCaps.OffScreenPlain = true; desc.Width = surfacePrimary.SurfaceDescription.Width; desc.Height = surfacePrimary.SurfaceDescription.Height; surfaceSecondary = new Surface(desc, localDevice); surfaceSecondary.FillStyle = 0; Bitmap bmp = new Bitmap(Image.FromFile("c:\\c#games\\JumpMan\\JumpMan.bmp", true)); bmp.MakeTransparent(Color.White); desc.Width = bmp.Width; desc.Height = bmp.Height; surfaceManSprite = new Surface(bmp, desc, localDevice); surfaceManSprite.FillStyle = 1; ColorKey ck = new ColorKey(); ck.ColorSpaceHighValue = -1; ck.ColorSpaceLowValue = -1; surfaceManSprite.SetColorKey(ColorKeyFlags.SourceDraw, ck); thanks, nick

Share this post

Link to post
Share on other sites