• Advertisement
Sign in to follow this  

DirectDraw, transparant problem

This topic is 4345 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

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
Advertisement
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
Sign in to follow this  

  • Advertisement