#include <stdio.h>
#include <gd.h>

int main()
{
 /*image initialisieren*/
 gdImagePtr image,brush1,brush2;
 FILE *png;
 int black, white, red, green, grey, blue;
 /*Image erstellen*/
 image = gdImageCreate(100,100);
 if(image==NULL) { /*Fehler*/ exit(0); }
 /*brush1 erstellen*/
 brush1 = gdImageCreate(5,5);
 if(brush1==NULL) { /*Fehler*/ exit(0); }
 /*brush2 erstellen*/
 brush2 = gdImageCreate(5,5);
 if(brush2==NULL) { /*Fehler*/ exit(0); }
 /*auf brush1 zeichnen*/
 white=gdImageColorAllocate(brush1,0,0,0);   /*Weiss*/
 blue=gdImageColorAllocate(brush1,0,0,255);   /*Blau*/
 brush1->transparent=white;
 gdImageLine(brush1,0,4,4,0,blue);  /*Nord nach Ost*/

 /*auf brush2 zeichnen*/
 white=gdImageColorAllocate(brush2,0,0,0);   /*Weiss*/
 blue=gdImageColorAllocate(brush2,0,0,255);   /*Blau*/
 red=gdImageColorAllocate(brush2,255,0,0);   /*Blau*/
 brush2->transparent=white;
 gdImageLine(brush2, 4,0,0,4, red);
 gdImageLine(brush2, 0,2,2,0, blue);

 white=gdImageColorAllocate(image,0,0,0);   /*Weiss*/
 image->transparent=white;

 /*brush1 setzen*/
 gdImageSetBrush(image,brush1);
 /*Einen Kreis mit der brush1 zeichnen */
 gdImageArc(image,30,50,50,50,0,360, gdBrushed);


 /*brush2 setzen*/
 gdImageSetBrush(image,brush2);
 /*Einen Kreis mit der brush2 zeichnen */
 gdImageRectangle(image,70,10,90,90, gdBrushed);


 png = fopen("bild5.png","wb");

 gdImagePng(image,png);

 fclose(png);

 gdImageDestroy(image);

 return 0;
}

