gdtestft.c

来自「Linux/Unix下的绘图函数库(Graphic Drawing Librar」· C语言 代码 · 共 47 行

C
47
字号
#ifdef HAVE_CONFIG_H#include "config.h"#endif#include "gd.h"#include <string.h>#include <stdlib.h>#define PI 3.141592#define DEG2RAD(x) ((x)*PI/180.)#define MAX(x,y) ((x) > (y) ? (x) : (y))#define MIN(x,y) ((x) < (y) ? (x) : (y))#define MAX4(x,y,z,w) \	((MAX((x),(y))) > (MAX((z),(w))) ? (MAX((x),(y))) : (MAX((z),(w))))#define MIN4(x,y,z,w) \	((MIN((x),(y))) < (MIN((z),(w))) ? (MIN((x),(y))) : (MIN((z),(w))))#define MAXX(x) MAX4(x[0],x[2],x[4],x[6])#define MINX(x) MIN4(x[0],x[2],x[4],x[6])#define MAXY(x) MAX4(x[1],x[3],x[5],x[7])#define MINY(x) MIN4(x[1],x[3],x[5],x[7])intmain (int argc, char *argv[]){#ifndef HAVE_LIBFREETYPE  fprintf (stderr, "gd was not compiled with HAVE_LIBFREETYPE defined.\n");  fprintf (stderr, "Install the FreeType library, including the\n");  fprintf (stderr, "header files. Then edit the gd Makefile, type\n");  fprintf (stderr, "make clean, and type make again.\n");  return 1;#else  gdImagePtr im;  int blue;  int blueAlpha;  int white;  int brect[8];  int x, y, sx, sy;  char *err;  FILE *out;#ifdef JISX0208  char *s = "Hello. 偙傫偵偪偼 Qyjpqg,";	/* String to draw. */#else  char *s = "Hello. 漩

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?