Sign in to follow this  
MarijnStevens

DirectDraw, transparant problem

Recommended Posts

I have a problem with transparant. I have a colorkey:
			ColorKey ck = new ColorKey(); 
			sprite.SetColorKey(ColorKeyFlags.SourceDraw, ck); 
and i have a picture with a pink look background and draw it with this code:
	backBuffer.Draw(new Rectangle(0,0,61,174),sprite,new Rectangle(0,0,61,174),DrawFlags.AlphaEdgeBlend,new DrawEffects());

I don't have a black background. The color of the background is: r: 255; g: 161; b: 254; I see a black screen, with a picture of a human, with a pink background. How can i make the background transparant ?

Share this post


Link to post
Share on other sites
You have to set the members of ck to the color you are using for the colorkey:


Color = Color.FromArgb(255,161,254);
ColorKey ck = new ColorKey();
ck.ColorSpaceHighValue = Color.ToArgb();
ck.ColorSpaceLowValue = Color.ToArgb();
sprite.SetColorKey(ColorKeyFlags.SourceDraw,ck);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this