Libpng is used for image processing, and zlib is used for compression. The two are closely related. libpng depends on zlib.
Compilation Library:
1. First download the libpng-1.5.12.tar.gz (http://sourceforge.net/projects/libpng/files/libpng15/1.5.12/) and libz (http://zlib.net/zlib-1.2.7.tar.gz), extract LibPNG, such as c: \ workspace \ libpng-1.5.12 \.
2. Decompress libz and rename zlib to the libpng directory of the same level, such as c: \ workspace \ zlib.
3. Enter libpng \ projects \ visualc71 \ and open the project file with Visual Studio. The solution has three sub-projects: LibPNG, pngtest, and zlib. Directly compile the file. The zlib1d. dll, libpng15d. dll, LibPNG. Lib, zlib, and other library files will be generated under the win32_dll_debug directory and win32_dll_debug \ zlib directory.
For projects that need to use these two databases, three things need to be done:
1. Project property-> Configuration properties-> C/C ++/General-> additional include directories Add the directories containing header files such as PNG. h
2. Add zlib. lib and LibPNG. lib to linker-> input-> additional dependencies.
3. In configuration properties-> VC ++ directories-> library directories, add the directories zlib. lib and LibPNG. Lib.