You are on page 1of 82

Graphics Programming http://www.scribd.

com/doc/7286484/Graphics-Programming

Scribd

Explore
Community

Upload a Document

Login
Sign Up
|
Log In

/ 42

s Document for Free

1 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

All Lines Are Not Same


Stylish Lines
Drawing and Filling Images
Patterns with A Difference
Why Use A bar( )?
Filling Regular and Non-Regular Sha
Of Palettes and Colors
Outputting Text
Justifying Text
A Bit of Animation
System Metrics
/ 42
Exercise
s Document for Free

2 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

3 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

116
C
omputer graphics is one of the most powerful
facet of computers. There is a lot that you can
apart from drawing figures of various shape
animation, multimedia predominantly works
graphics. The intention of this chapter is to give
some of these things are achieved in C. The ai
comfortable with the basic concepts in graphics
the standard library graphics functions and then
your own. Instead of discussing each standar
function in detail I thought it worthwhile to put
program. The purpose of these functions, the
parameters passed to each function and the
functions is discussed in Appendix A at the end o
the first program...

# include "graphics.h"
main( )
/ 42
{
s Document for Free int gd = DETECT, gm, x, y ;
int array[ ] = { 540, 220, 590, 270, 570, 320,
4 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

5 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

Chapter 20: Graphics Programming


outtextxy ( x / 2 - textwidth ( "Circle" ) / 2, y
10, "Circle" ) ;

arc ( x / 1.2, y / 6, 300, 90, 80 ) ;


outtextxy ( x / 1.2, y / 6, "Arc" ) ;

line ( x / 30, 10 * y / 15, x / 6, 10 * y / 15 ) ;


outtextxy ( x / 30 + 10, 10 * y / 15 + 10, "Lin

ellipse ( x / 2, 10 * y / 17, 0, 360, 100, 50 ) ;


putpixel ( x / 2, 10 * y / 17, WHITE ) ;
outtextxy ( x / 2 - textwidth ( "Ellipse" ) / 2, 1
17 + 10, "Ellipse" ) ;

drawpoly ( 6, array ) ;
outtextxy ( 515, 270, "Polygon" ) ;

getch( ) ;
closegraph( ) ;
/ 42
restorecrtmode( ) ;
s Document for Free }

6 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

Like Be the first of your friends to like this.

/ 42

s Document for Free

7 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

8 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

9 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

10 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

11 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

12 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

13 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

14 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

15 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

16 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

17 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

18 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

19 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

20 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

21 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

22 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

23 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

24 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

25 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

26 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

27 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

28 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

29 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

30 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

31 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

32 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

33 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

34 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

35 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

36 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

37 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

38 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

39 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

40 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

41 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

42 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

43 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

44 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

45 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

46 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

47 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

48 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

49 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

50 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

51 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

52 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

53 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

54 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

55 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

56 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

57 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

58 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

59 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

60 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

61 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

62 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

63 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

64 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

65 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

66 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

67 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

68 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

69 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

70 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

71 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

72 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

73 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

74 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

75 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

76 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

77 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

78 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

79 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

/ 42

s Document for Free

80 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

Upload a Document

Scribd

About
Press
Jobs
Contact
Blog
Scribd Store

Legal

Terms - General
Terms - API
Terms - Privacy
Copyright

Help & Tools

Getting Started
Community Guidelines
Support & FAQ
Web Stuff

Partners

Partners
Branded Reader
Developers / API

Subscribe to Us

On Scribd
On Twitter
On Facebook

What's ew
/ 42
We have updated our Terms of Service
s Document for Branded
Free Reader

81 of 82 8/6/2010 7:42 AM
Graphics Programming http://www.scribd.com/doc/7286484/Graphics-Programming

Desktop Uploader

/ 42

s Document for Free

82 of 82 8/6/2010 7:42 AM

You might also like