Jump to content
  • Advertisement
Sign in to follow this  
Robinhood

How to Display PNG Files with Alpha Channel?

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

Here is my code: CImage img; //Constructor img.Load("Test.png"); //OnDraw img.AlphaBlend(pDC,0,0,width,height,0,0,width,height); the code above doesn't display PNG very well, and there is some mess in the picture. Someone help me!

Share this post


Link to post
Share on other sites
Advertisement
It's pretty hard to tell what's wrong without seeing the code for CImage::Load and CImage::AlphaBlend, and it's hard to understand what's wrong from the description that it doesn't display it very well and with some mess. It would help if you could post some screenshots of the problem. Also post the code for your load and alphablend functions, and tell us what the alphablend functon's supposed to do. If CImage is a class from some image loading library then tell us which one as well.

PS: When you post your code, put [ source ][ /source ] tags around it (without the spaces inside the brackets) to make it more readable.

Share this post


Link to post
Share on other sites
Press Printscreen when you have the screen you want to save, then go to Paint, hit paste, and save.

Share this post


Link to post
Share on other sites
When you load the picture, are you certain you are getting the alpha channel, or that one exists in the picture you're using? Tons of test pictures for different types of png images are available at the libpng website, http://www.libpng.org/

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!