Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read a PNG Using Win32 / C++

That there is no simple way to read a PNG file into a memory bitmap in native Windows seemed impossible, but after much googling I'm beginning to believe it. The libpng/zlib combination is just too big. Any third-party libraries Win32 libraries out there for reading a PNG?

Edit: The boost::gil::png solution is much more complex than I'd hoped, too. Just need a single call that takes a file name and fills a memory buffer with pixels.

like image 743
I. J. Kennedy Avatar asked Sep 08 '09 01:09

I. J. Kennedy


1 Answers

Or of course you could use GDI+ - The Bitmap object takes a string constructor and loads the specified file into memory. That way you don't need any external libraries, just that which comes with windows.

like image 168
ReinstateMonica Larry Osterman Avatar answered Sep 17 '22 14:09

ReinstateMonica Larry Osterman