Or maybe how to load a 32-bit bitmap? There MUST be a way to load an image with alpha transparency in native Win32.
Main Topics
Browse All TopicsHi all,
I've been searching all day for a way to load a 32-bit png image from a ressource in my app (from it's ID) and draw it in the specified device context, while keeping alpha transparency? I tried numerous things but none of them works (Win GDI, GDI+). Any clue on how to do achieve this?
My app is non-MFC and non-ATL, pure Win32.
Thanks in advance!!!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
PNGLib: http://www.libpng.org/pub/
http
a wrapper around it: http://bitbucket.org/edd/p
I think CxImage is not bad also: http://sourceforge.net/pro
Here is a much longer list: http://www.libpng.org/pub/
If GDI+ is also good: http://www.cplusplus.com/f
Example in C#: http://social.msdn.microso
WTL (the simplest?):
CImage img;
img.Load("picture.png"
@jkr: probably, you are wrong. But, I think, we can say that this Win32 API:
http://msdn.microsoft.
Sh
CImage provides enhanced bitmap support, including the ability to load and save images in JPEG, GIF, BMP, and Portable Network Graphics (PNG) formats.
@JohnGaby:
Thank you very much for your code, but unfortunately nothing is drawn. I am able to get to the last nested block, but if I set a break point on line 38 (graphics.DrawImage(&image
Anyway, I will accept your comment as a solution.
Here is a link to the relevant page:
http://msdn.microsoft.com/
Business Accounts
Answer for Membership
by: jkrPosted on 2009-09-15 at 12:38:26ID: 25338489
Winbdows cannot handle PNGs natively, you'll need a helper library like this one here: http://www.codeproject.com /KB/graphi cs/cximage .aspx ("CxImage")