diff options
author | Volker Grabsch <vog@notjusthosting.com> | 2010-07-16 16:33:15 (GMT) |
---|---|---|
committer | Volker Grabsch <vog@notjusthosting.com> | 2010-07-16 16:33:15 (GMT) |
commit | 418bbeb8b92ffc950aa2030da4899104fd7320d4 (patch) | |
tree | 744a4a641dcd070026898744cefc16884b235bf0 /src/gd-test.c | |
parent | 3b6d4a1d3805825e3dfd69221040416d8bda51c3 (diff) | |
download | mxe-418bbeb8b92ffc950aa2030da4899104fd7320d4.zip mxe-418bbeb8b92ffc950aa2030da4899104fd7320d4.tar.gz mxe-418bbeb8b92ffc950aa2030da4899104fd7320d4.tar.bz2 |
test program for package gd (by Tony Theodore)
Diffstat (limited to 'src/gd-test.c')
-rw-r--r-- | src/gd-test.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gd-test.c b/src/gd-test.c new file mode 100644 index 0000000..2d6be72 --- /dev/null +++ b/src/gd-test.c @@ -0,0 +1,32 @@ +/* This file is part of mingw-cross-env. */ +/* See doc/index.html for further information. */ + +/* modified from /examples/arc.c */ + +#include "gd.h" +#include <stdio.h> +#include <stdlib.h> + +int main() +{ + gdImagePtr im; + FILE *fp; + int cor_rad = 400; + im = gdImageCreateTrueColor(400, 400); + gdImageFilledRectangle(im, 0, 0, 399, 399, 0x00FFFFFF); + + gdImageFilledArc(im, cor_rad, 399 - cor_rad, cor_rad * 2, cor_rad * 2, 90, 180, 0x0, gdPie); + + fp = fopen("test-gd.png", "wb"); + if (!fp) { + fprintf(stderr, "Can't save png image.\n"); + gdImageDestroy(im); + return 1; + } + gdImagePng(im, fp); + fclose(fp); + + fprintf(stdout, "test-gd.png created\n"); + gdImageDestroy(im); + return 0; +} |