使用Win32/C ++读取PNG [英] Read a PNG Using Win32 / C++
问题描述
在本地Windows中没有简单的方法将PNG文件读入内存位图中似乎是不可能的,但是经过大量的搜索之后,我开始相信它. libpng/zlib组合太大.那里有第三方库Win32库用于读取PNG吗?
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?
boost :: gil :: png解决方案也比我希望的复杂得多.只需一个调用即可,该调用需要一个文件名,并用像素填充内存缓冲区.
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.
这篇关于使用Win32/C ++读取PNG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!