Help converting a bitmap to a png in memory using libpng

孤者浪人 提交于 2019-12-12 08:13:19

问题


Basically I would like to convert a bitmap to a png using libpng but rather than outputting it to a FILE* I would like to output it to a char*. I have already seen this related post but I don't see where the bitmap data is actually used. Any help would be appreciated.


回答1:


Use the png_set_write_fn function to redirect writes to your own function; this function, which you need to write, can store the output in any way you want.

See the documentation at http://www.libpng.org/pub/png/libpng-manual.txt



来源:https://stackoverflow.com/questions/3739667/help-converting-a-bitmap-to-a-png-in-memory-using-libpng

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!