资源简介
zlib源码+libpng源码,可运行工程
zlib源码+libpng源码,可运行工程
zlib源码+libpng源码,可运行工程
zlib源码+libpng源码,可运行工程
zlib源码+libpng源码,可运行工程
zlib源码+libpng源码,可运行工程
zlib源码+libpng源码,可运行工程

代码片段和文件信息
#if 0 /* in case someone actually tries to compile this */
/* example.c - an example of using libpng
* Last changed in libpng 1.2.35 [February 14 2009]
* This file has been placed in the public domain by the authors.
* Maintained 1998-2009 Glenn Randers-Pehrson
* Maintained 1996 1997 Andreas Dilger)
* Written 1995 1996 Guy Eric Schalnat Group 42 Inc.)
*/
/* This is an example of how to use libpng to read and write PNG files.
* The file libpng.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.
*/
#include “png.h“
/* The png_jmpbuf() macro used in error handling became available in
* libpng version 1.0.6. If you want to be able to run your code with older
* versions of libpng you must define the macro yourself (but only if it
* is not already defined by libpng!).
*/
#ifndef png_jmpbuf
# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
#endif
/* Check to see if a file is a PNG file using png_sig_cmp(). png_sig_cmp()
* returns zero if the image is a PNG and nonzero if it isn‘t a PNG.
*
* The function check_if_png() shown here but not used returns nonzero (true)
* if the file can be opened and is a PNG 0 (false) otherwise.
*
* If this call is successful and you are going to keep the file open
* you should call png_set_sig_bytes(png_ptr PNG_BYTES_TO_CHECK); once
* you have created the png_ptr so that libpng knows your application
* has read that many bytes from the start of the file. Make sure you
* don‘t call png_set_sig_bytes() with more than 8 bytes read or give it
* an incorrect number of bytes read or you will either have read too
* many bytes (your fault) or you are telling libpng to read the wrong
* number of magic bytes (also your fault).
*
* Many applications already read the first 2 or 4 bytes from the start
* of the image to determine the file type so it would be easiest just
* to pass the bytes to png_sig_cmp() or even skip that if you know
* you have a PNG file and call png_set_sig_bytes().
*/
#define PNG_BYTES_TO_CHECK 4
int check_if_png(char *file_name FILE **fp)
{
char buf[PNG_BYTES_TO_CHECK];
/* Open the prospective PNG file. */
if ((*fp = fopen(file_name “rb“)) == NULL)
return 0;
/* Read in some of the signature bytes */
if (fread(buf 1 PNG_BYTES_TO_CHECK *fp) != PNG_BYTES_TO_CHECK)
return 0;
/* Compare the first PNG_BYTES_TO_CHECK bytes of the signature.
Return nonzero
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 312725 2009-02-15 05:59 zlib+libpng\d7885b5e5873\aclocal.m4
文件 1501 2009-02-15 05:59 zlib+libpng\d7885b5e5873\ANNOUNCE
文件 639 2008-05-02 10:44 zlib+libpng\d7885b5e5873\autogen.sh
文件 115802 2009-02-15 05:59 zlib+libpng\d7885b5e5873\CHANGES
文件 44878 2008-05-02 11:50 zlib+libpng\d7885b5e5873\config.guess
文件 2150 2009-02-15 05:59 zlib+libpng\d7885b5e5873\config.h.in
文件 33387 2008-05-02 11:50 zlib+libpng\d7885b5e5873\config.sub
文件 435168 2009-02-15 05:59 zlib+libpng\d7885b5e5873\configure
文件 4266 2009-02-15 05:59 zlib+libpng\d7885b5e5873\configure.ac
文件 17992 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\COPYING
文件 2373 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\LICENSE
文件 3905 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\Makefile.mingw32
文件 2966 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\Makefile.sgi
文件 4010 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\Makefile.unx
文件 3335 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\Makefile.w32
文件 3557 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\makevms.com
文件 7801 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\README
文件 9758 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\readpng.c
文件 3260 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\readpng.h
文件 24685 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\readpng2.c
文件 3942 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\readpng2.h
文件 5424 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\readppm.c
文件 22911 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\rpng-win.c
文件 30776 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\rpng-x.c
文件 45309 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\rpng2-win.c
文件 82268 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\rpng2-x.c
文件 12901 1997-04-09 02:34 zlib+libpng\d7885b5e5873\contrib\gregbook\toucan.png
文件 31050 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\wpng.c
文件 12789 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\writepng.c
文件 4237 2009-02-15 05:59 zlib+libpng\d7885b5e5873\contrib\gregbook\writepng.h
............此处省略512个文件信息
- 上一篇:课程设计-----图书管理系统.rar
- 下一篇:微分几何与拓扑学教程
相关资源
- 易语言取程序运行时间模块源码
- 易语言编译原理 易语言循环首尾配对
- delphi源码-检测是否运行了多个程序
- 易语言API定时关机源码
- 易语言小轩定时关机源码
- Delphi时钟助手源码,定时关机、提醒
- delphi源码-实现软件注册机
- 易语言mp3播放器3源码易语言mp3播放器
- 易语言QEHashV3.0源码
- 易语言打开记事本并写入内容源码
- 易语言完美模块化3.0源码易语言报表
- 易语言凡哥记事本V1源码易语言凡哥记
- 易语言屏幕画笔v3源码易语言屏幕画笔
- 易语言拖盘图标操作例程源码
- 易语言动态随机文本加解密源码
- 易语言自定义加解密文本源码
- 易语言字符串加解密源码
- 易语言加解密文本模块源码
- 易语言文本加解密源码
- 易语言极速文本加密解密模块V3.1模块
- 易语言码表文本加解密模块源码
- 易语言加解密例程源码易语言生成随
- 易语言文本加解密例程源码
- 易语言高仿Windows记事本源码
- 易语言加密记事本简单例程源码
- 微信、QQ、TIM、QQ轻聊版防撤回软件(
- Altium Designer dblib简易制作教程
- Beginning STM32: Developing with FreeRTOS libo
- stm32f103c8t6_sch.Lib
- Borland Socket Server程序 包含D6和D7源码
评论
共有 条评论