2
  1. I read and try that pure Magenta Color 255, 0, 255 in an image is automatically transparent, but unfortunately failed, is there anything should I setup first?

  2. Also I read and try include alpha in a PNG Image, the strange is when I used it on a project it's work, but not on the other, what is likely wrong with the code?

Please kindly reply, thank you

user733916
  • 143
  • 1
  • 6
  • 15

1 Answers1

4

For Magenta to be transparent, look at the properties of your image file. Right click in solution explorer, properties.

There is an option there to specify the transparent color to be used (magenta by default).

Then, there is the rendering to consider. How are you drawing your texture? With SpriteBatch, it is automatic, but you may have sorting issues. Check the order in which you draw your textures and the SpriteSortMode.

jv42
  • 8,521
  • 5
  • 40
  • 64
  • Thank you for your answer, I'm using Game Studio 4.0 and draw the texture uses BasicEffect.Effect on a Quad Billboard. Could you please guide me where exactly the OPTION for choosing transparent color? Because I can't find it on the PNG content properties. The weird thing is on some project it does transparent while on another is not, and so what I've done currently is using the project which transparent as bases for another project... – user733916 May 18 '11 at 01:01
  • Could you just try to render it using a SpriteBatch? That should show whether it's a data issue or a render issue. – jv42 May 18 '11 at 11:44
  • I just spent two days trying to work out why one texture doesn't work as a parallax map, while another did. This was the culprit. Thank you! – Jeff Sep 30 '12 at 04:42