#include <stdio.h>
#include <gd.h>

int main()
{
 /*image initialisieren*/
 gdImagePtr image;
 FILE *png,*jpeg;
 int black, white, red, green, grey, blue;
 gdPoint punkte[4];

 /*Neues Image erstellen*/
 image = gdImageCreate(100,100);
 if(image==NULL) { /*Fehler*/ exit(0); }

 white=gdImageColorAllocate(image,255,255,255);
 black=gdImageColorAllocate(image,0,0,0);
 red  =gdImageColorAllocate(image,255,0,0);

 image->transparent=white;

 punkte[0].x=0;
 punkte[0].y=0;
 punkte[1].x=50;
 punkte[1].y=40;
 punkte[2].x=30;
 punkte[2].y=80;
 punkte[3].x=0;
 punkte[3].y=0;

 gdImageFilledPolygon(image, punkte, 4, red);

 png = fopen("bild11.png","wb");

 gdImagePng(image,png);

 fclose(png);

 gdImageDestroy(image);

 return 0;
}
