CImg应用-保存png图片

来源:互联网 发布:如何向opta购买数据 编辑:程序博客网 时间:2024/05/16 08:45

1、Linux系统有pngzlib库的支持。

zlib下载地址:http://www.zlib.net/

png下载地址:http://www.libpng.org/pub/png/

 

2、声明对png的引用。

#define cimg_use_png

#include "CImg.h"

 

3、保存图片

img.save_png(strNameRight.c_str());

 

 

在安装zlibpng之后,要在/etc/ld.so.conf中包含路径/usr/local/lib,并执行ldconfig命令。

0 0
原创粉丝点击