0% found this document useful (0 votes)
41 views2 pages

Asgnment Graphics 3

This document provides code to draw various shapes using drawing functions in C. It uses functions like setcolor, rectangle, ellipse, line, setfillstyle, and floodfill to draw filled and unfilled rectangles, ellipses, and a triangle of different colors and patterns. The code sets colors, draws the outlines of shapes, sets fill styles, and fills the inside areas to demonstrate using drawing functions to create simple graphics.

Uploaded by

Surf'juan Saaid
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views2 pages

Asgnment Graphics 3

This document provides code to draw various shapes using drawing functions in C. It uses functions like setcolor, rectangle, ellipse, line, setfillstyle, and floodfill to draw filled and unfilled rectangles, ellipses, and a triangle of different colors and patterns. The code sets colors, draws the outlines of shapes, sets fill styles, and fills the inside areas to demonstrate using drawing functions to create simple graphics.

Uploaded by

Surf'juan Saaid
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy