gd库
来源:互联网 发布:济南seo整站优化方案 编辑:程序博客网 时间:2024/04/29 08:49
/* Bring in gd library functions */
#include "gd.h"
/* Bring in standard I/O so we can output the PNG to a file */
#include <stdio.h>
int main() {
/* Declare the image */
gdImagePtr im;
/* Declare output files */
FILE *pngout, *jpegout;
/* Declare color indexes */
int black;
int white;
/* Allocate the image: 64 pixels across by 64 pixels tall */
im = gdImageCreate(64, 64);
/* Allocate the color black (red, green and blue all minimum).
Since this is the first color in a new image, it will
be the background color. */
black = gdImageColorAllocate(im, 0, 0, 0);
/* Allocate the color white (red, green and blue all maximum). */
white = gdImageColorAllocate(im, 255, 255, 255);
/* Draw a line from the upper left to the lower right,
using white color index. */
gdImageLine(im, 0, 0, 63, 63, white);
/* Open a file for writing. "wb" means "write binary", important
under MSDOS, harmless under Unix. */
pngout = fopen("test.png", "wb");
/* Do the same for a JPEG-format file. */
jpegout = fopen("test.jpg", "wb");
/* Output the image to the disk file in PNG format. */
gdImagePng(im, pngout);
/* Output the same image in JPEG format, using the default
JPEG quality setting. */
gdImageJpeg(im, jpegout, -1);
/* Close the files. */
fclose(pngout);
fclose(jpegout);
/* Destroy the image in memory. */
gdImageDestroy(im);
}
- gd库
- GD库
- gd库
- GD库
- GD库
- GD库
- GD库的安装
- php安装GD库
- php配置GD库
- php安装GD库
- php5安装GD库
- php配置GD库
- 安装GD库
- php 安装GD库
- CentOS安装GD库
- GD库安装
- php GD库
- GD库的介绍
- Android 的系统属性(SystemProperties)设置分析
- 管理相关
- Android开发
- 下载、编译Ogre1.7.2
- 缺省参数是在编译期决定的
- gd库
- MyEclipse 使用总结
- Microsoft Office Home and Student 2007 密匙
- linux安装jdk.tomcat,mysql 的一些记录
- GetRoProperty与GetToProperty函数
- Android应用及应用管理
- runtime.exec
- http://www.dumpanalysis.org 内容一览
- Javascript:控制Li选中项样式