Reading PNG using Win32 / C ++

That there is no easy way to read a PNG file into a memory bitmap in native Windows, it seemed impossible, but after a lot of searching, I begin to believe in it. The libpng / zlib combination is too large. What third-party Win32 libraries exist for reading PNG?

Edit: solution boost :: gil :: png is much more complicated than I had hoped. You just need one call that takes a file name and fills the memory buffer with pixels.

+7
windows winapi png
source share
4 answers

Or, of course, you can use GDI + - The Bitmap object takes a string constructor and loads the specified file into memory. Thus, you do not need any external libraries, only what comes with windows.

+17
source share

libgd is a great library that can be used on Windows and has bindings for many popular languages.

+1
source share

There are several built-in materials that you can use: IImgCtx , and in later versions of the windows you also have a WIC

0
source share

I have successfully used libpng to do this.

-one
source share

All Articles