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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With