Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

TITLE : USING DRAWING FUNCTIONS

CODING
#include glib.h
void main(void)
{
ginit();
{
setcolor(15); //* set the painting color white *//
rectangle(200,205.5,350.5,160.5);
//* draw rectangle *//
setfillstyle(4,12);
//* paint inside with color red with pattern 4 *//
floodfill(250,180,15);
//* fill inside the rectangle *//
setcolor(5); //* set the painting color purple *//
rectangle(200,230,100,140); //* draw rectangle *//
setfillstyle(2,14); //* paint inside with color bright yellow with pattern 2 *//
floodfill(195,225,5); //* fill inside the rectangle *//
setcolor(14); //* set the painting color bright yellow *//
rectangle(265.205.5,280,350); //* draw rectangle *//
setfillstyle(5,9); //* paint inside with color bright blue with pattern 5 *//
floodfill(279,250,14); //* fill the rectangle *//
setcolor(6); //*set the painting color yellow *//
ellipse(430,185.5,0,360,80,50.5); //* draw ellipse *//
setfillstyle(9,10); //*paint inside with bright blue with pattern 9 *//
floodfill(370,170,6); //* fill inside the ellipse *//
setcolor(4); //* set the painting color red *//
ellipse(430,185,0,360,30,25); //*draw ellipse *//
setfillstyle(5,15); //* paint inside with white with pattern 5 *//
floodfill(270.5,400,2); //* fill inside the ellipse *//
setcolor(2); //* set the painting color green *//
ellipse(270.5,400,0,360,100,50); //* draw ellipse *//
setfillstyle(11,5); //* paint inside with purple with pattern 11 *//
floodfill(270,400,2); //* fill inside the ellipse *//

setcolor(9); //* set the painting color bright blue*//


line(150,160,170,200); //* draw line *//
line(150,160,128,200); //*draw line *//
line(128,200,170,200); //* draw line *//
setfillstyle(6,4); //* paint inside with color red with pattern 6 *//
floodfill(150,180,9); //* fill inside the triangle *//
}
getchar();
gclose();
}

OUTPUT :

You might also like