tags:

views:

70

answers:

3

I am currently drawing single colored pixels to my texture in XNA. However, there seems to be blending occuring, as the color I draw on the screen gets blended with my background color. How can I turn this off so that the color I draw is only the color I draw?

this.spriteBatch.Draw(texture, new Rectangle(x, y, 1, 1), [My Color]);
+1  A: 

Check the alpha channel of "[My Color]".

Alternatively:

device.RenderState.AlphaBlendEnable = false;
Foole
A: 

Pass a SpriteBlendMode enumeration into your SpriteBatch.Begin call to turn off alpha blending:

spriteBatch.Begin(SpriteBlendMode.None);
Bob
A: 

I tried the methods above without any luck. Instead I created a 1x1 solid white pixel and used that as a base to color on. It solved the blending problem.

George