-
大小: 14.24MB文件类型: .rar金币: 1下载: 0 次发布日期: 2023-07-14
- 语言: 其他
- 标签: libpng+zlib code+dl+lib
资源简介
libpng+zlib 有源代码和已经编译好的dll和lib,在lpng1630\projects\vstudio\Debug 目录下,VS中加入引用头文件,lib和Dll直接可以用,亲测。
代码片段和文件信息
#if 0 /* in case someone actually tries to compile this */
/* example.c - an example of using libpng
* Last changed in libpng 1.6.24 [August 4 2016]
* Maintained 1998-2016 Glenn Randers-Pehrson
* Maintained 1996 1997 Andreas Dilger)
* Written 1995 1996 Guy Eric Schalnat Group 42 Inc.)
* To the extent possible under law the authors have waived
* all copyright and related or neighboring rights to this file.
* This work is published from: United States.
*/
/* This is an example of how to use libpng to read and write PNG files.
* The file libpng-manual.txt is much more verbose then this. If you have not
* read it do so first. This was designed to be a starting point of an
* implementation. This is not officially part of libpng is hereby placed
* in the public domain and therefore does not require a copyright notice.
*
* This file does not currently compile because it is missing certain
* parts like allocating memory to hold an image. You will have to
* supply these parts to get it to compile. For an example of a minimal
* working PNG reader/writer see pngtest.c included in this distribution;
* see also the programs in the contrib directory.
*/
/* The simple but restricted approach to reading a PNG file or data stream
* just requires two function calls as in the following complete program.
* Writing a file just needs one function call so long as the data has an
* appropriate layout.
*
* The following code reads PNG image data from a file and writes it in a
* potentially new format to a new file. While this code will compile there is
* minimal (insufficient) error checking; for a more realistic version look at
* contrib/examples/pngtopng.c
*/
#include
#include
#include
#include
#include
#include
int main(int argc const char **argv)
{
if (argc == 3)
{
png_image image; /* The control structure used by libpng */
/* Initialize the ‘png_image‘ structure. */
memset(&image 0 (sizeof image));
image.version = PNG_IMAGE_VERSION;
/* The first argument is the file to read: */
if (png_image_begin_read_from_file(&image argv[1]) != 0)
{
png_bytep buffer;
/* Set the format in which to read the PNG file; this code chooses a
* simple sRGB format with a non-associated alpha channel adequate to
* store most images.
*/
image.format = PNG_FORMAT_RGBA;
/* Now allocate enough memory to hold the image in this format; the
* PNG_IMAGE_SIZE macro uses the information about the image (width
* height and format) stored in ‘image‘.
*/
buffer = malloc(PNG_IMAGE_SIZE(image));
/* If enough memory was available read the image in the desired format
* then write the result out to the new file. ‘background‘ is not
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4968 2011-09-11 07:15 zlib-1.2.8\adler32.c
文件 1981 2010-02-14 08:22 zlib-1.2.8\amiga\Makefile.pup
文件 1847 2010-02-14 08:22 zlib-1.2.8\amiga\Makefile.sas
文件 8485 2013-03-24 14:32 zlib-1.2.8\as400\bndsrc
文件 5291 2013-04-29 06:57 zlib-1.2.8\as400\compile.clp
文件 4991 2013-04-29 06:57 zlib-1.2.8\as400\readme.txt
文件 27886 2013-04-29 06:57 zlib-1.2.8\as400\zlib.inc
文件 76402 2013-04-29 08:23 zlib-1.2.8\ChangeLog
文件 8098 2013-04-29 06:57 zlib-1.2.8\CMakeLists.txt
文件 2529 2012-08-13 15:02 zlib-1.2.8\compress.c
文件 26082 2013-03-24 13:30 zlib-1.2.8\configure
文件 3717 2004-09-06 14:55 zlib-1.2.8\contrib\ada\buffer_demo.adb
文件 4467 2004-07-23 15:49 zlib-1.2.8\contrib\ada\mtest.adb
文件 4248 2004-05-31 18:53 zlib-1.2.8\contrib\ada\read.adb
文件 2178 2004-10-04 09:54 zlib-1.2.8\contrib\ada\readme.txt
文件 13180 2004-05-31 18:51 zlib-1.2.8\contrib\ada\test.adb
文件 5996 2004-10-04 09:55 zlib-1.2.8\contrib\ada\zlib-streams.adb
文件 4330 2004-10-04 09:55 zlib-1.2.8\contrib\ada\zlib-streams.ads
文件 3329 2003-12-15 18:52 zlib-1.2.8\contrib\ada\zlib-thin.adb
文件 15819 2004-07-23 14:33 zlib-1.2.8\contrib\ada\zlib-thin.ads
文件 20400 2004-09-06 14:53 zlib-1.2.8\contrib\ada\zlib.adb
文件 13594 2004-09-06 14:53 zlib-1.2.8\contrib\ada\zlib.ads
文件 511 2004-10-04 09:58 zlib-1.2.8\contrib\ada\zlib.gpr
文件 12418 2010-02-24 15:04 zlib-1.2.8\contrib\amd64\amd64-match.S
文件 10365 2011-09-11 05:50 zlib-1.2.8\contrib\asm686\match.S
文件 1622 2010-02-24 00:06 zlib-1.2.8\contrib\asm686\README.686
文件 17572 2012-10-25 13:50 zlib-1.2.8\contrib\blast\blast.c
文件 3433 2012-10-25 13:47 zlib-1.2.8\contrib\blast\blast.h
文件 127 2003-03-03 13:45 zlib-1.2.8\contrib\blast\Makefile
文件 74 2003-03-04 14:42 zlib-1.2.8\contrib\blast\README
............此处省略829个文件信息
评论
共有 条评论