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

Recommended Posts

Heya all, I am trying to load a 32 Bit PNG file. I created the file in photoshop and it has transparent parts. I am using my own image loader ( using libpng ). When I load this and use it, the transparent areas are light blue! But wait, before you say "there's a problem with your loader code". I used D3DX to load the image...same result! So I went and: Open with windows image viewer: Transparency is correct Open with windows paint: Transparency is light blue! I don't know what is wrong. I tried different exporters to! When I use Paint Shop Pro the transparent sections become black. Any advice? I did not turn any alpha blending settings on in D3D. Do I have to? I tried this same thing using 32Bit TGA / DDS and the transparency works perfectly without enabling alpha related states. Please help, Thanks! - Shock

Share on other sites
when you created your image in photoshop did you actually create an alpha channel?... or did you just have transparent parts on you layer....

Share on other sites
Does Dx even use transparent layer information? Or does it have to have a transparent color key set (that's the way it worked in DirectDraw Version 6) - cause all images get loaded to a in memory bitmap format regardless of source, and I don't think the in memory format has "transparency" ... just colors and color keys (applied while bliting).

Share on other sites
Since you have loaded the image, you need to tell Direct3D how to handle the rendering of the image. You have to do some kind of alpha blending.
something like this.
Device.RenderState.SourceBlend = Blend.SourceAlpha;Device.RenderState.DestinationBlend = Blend.InvSourceAlpha;Device.RenderState.AlphaBlendEnable = true;

I hope this helps.
Take care.

1. 1
2. 2
3. 3
Rutin
22
4. 4
JoeJ
16
5. 5

• 14
• 29
• 11
• 11
• 9
• Forum Statistics

• Total Topics
631775
• Total Posts
3002277
×