You are on page 1of 15

<graphics.

h>
:
;("inttgraph(&draiver,&mode,"path

-1

-2

;()cleardevice

-3

;(setviewport(i1,i2,i3,i4,i5

-4

;()clearviewport

-5

;()restorecrtmode

-6

;()closegraph

-7

;(setcolor(i

-8

;(setbkcolor(i

-9

;(setfillattern(s,i

pattern -10

;(setfillstyle(i1,i2

-11

;(setpallette(i1,i2

-12

;(putpixel(i1,i2,i3

-13

getpixel(i1,i2); i3

-14

;(floodfill(i1,i2,i

-15

getcolor(); i

-16

getbkcolor(); i

-17

;(line(x1,y1,x2,y2
;(lineto(x,y

-18
-19

graphresult();

;(linerel(x,y
;(circile(x,y,R
;(arc(x,y,start,end,R
;(pieslice(i1,i2,i3,i4,i5
;(fillellipse(i1,i2,i3,i4,i5,i6
;(ellipse(i1,i2,i3,i4,i5,i6
;(sector(i1,i2,i3,i4,i5,o6
;(rectangle(i1,i2,i3,i4
;(bar(i1,i2,i3,i4
;(bar3d(i1,i2,i3,i4,i5,i6
;(drawpoly(d,p
;(fillpoly(I,p
;(outtext(s
;(outtextxy(x,y,s
;(settextstyle(i1,i2,i3
;(moveto(x,y
;(moverel(x,y

-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36

;(initgraph(driver,mode,path ( 1


Driver
Mode
) (
Path ) (driver ).
(bgi ) (tc\bgi \..
;int driver=0,mode=0

;(initgraph(&driver,&mode,c:\tc\bgi

(2

;()graphresult

(3

;()cleardevice

;(setviewport(i1,i2,i3,i4,i5

(4
) (
:
) (i1.i2
) (i3,i4

) (i5

:

;(setviewport(120,130,350,160,1

(5 ;()clearviewport

(6 ;()restorectmode

(7 ;()closegraph

(8 ;()setcolor


setcolor(4 :

;);(setcolor(RED

or

0
1
2
3
4
5
6
7

(9

;( setbkcolor(3 :

;(setbkcolor(i

8
9
10
11
12
13
14
15

<include<graphics.h#
<include<stdio.h#
<include<conio.h#
<include<stdlib.h#
()void main
}
;int gd=0,gm=0
;("initgraph(&gd,gm,"c:\tc\bgi
(if(garphresult() != graok
}
;(" ! puts("\ngraphics initalation error
;(exit(1
{
;()cleardevice
;(setviewport(120,120,130,350,160,1
;("outtext)"this is a view port
;()getch
;()clearviewport
;()restorecrtmode
;("printf("We are now in text mode\n
;()closegraph
;()getch
{

(10 setpattern(s,i

;(pattern

pattern
: Pattern
Pattern 8*8
s 8
pattern
::i pattern
: pattern
8*8
:

-1 1 0
-2
-3
-4

8=00001000
1c=00011100
22=00100010
7f=01111111
22=00100010
2a=00101010
3e=00111110
;(Setfillpattern("0*8,0*1c,0*22,0*7f,0*22,0*2a,0*3e",RED
pattern

(11 ;(setfillstyle(i1,i2

i1 i2

(12

;(setpallatte(i1,i2

(13 ;(putpixel(x,y,i

) (x,y i

(14 ;(getpixel(x,y

) (x,y

(15 ;(floodfill(i1,i2,i3
i3
) (i1,i2

(16 ;()getcolor

(17 ;()getbkcolor

(18 ;(line(x1,y1,x2,y2
) (x1,y1 ) (x2,y2

(19 ;(line(x,y

) (x,y

(20 ;(linerel(x,y
7

x x y y

(21 ;(circle(x,y,R

) (x,y R

(22 ;(arc(i1,i1,i3,i4,i5

(23 ;(pieslice(i1,i2,i3,i4,i5

) (i1,i2 i3 i4 i5

(24 ;(fillellipse(i1,i2,i3,i4

pattern
) (i1,i2 (i3) (i4)

(25 ;(ellipse(i1,i2,i3,i4,i5,i6

) (i1,i2 (i3,i4) (i5,i6)

(26 ;(sector(i1,i2,i3,i4,i5,i6


) (i1,i2 ) (i3,i4 ) (i5,i6

:
<include<graphics .h#
<include<stdio.h#
()Void main
}
;Int driver=DETECT,mode=0,errorcode
;()Clrscr
;("",Initgraph(&driver,&mode
;()Errorcode=garpfresulte
;()Cleardevice
:(Setcolor(WHITE
;(setbkcolor(BLACK
;(Pieslice(200,200,180,340,60
;(Sector(200,200,180,60,40
;()Closegraph
{

(27 ;(rectangle(i1,i2,i3,i4

) (i1,i2
) (i3,i4

)(i1,i2

)(i3,i4

(28 ;(bar(i1,i2,i3,i4

rectangle
pattern

(29 ;(bar3d(i1,i2,i3,i4,i5,i6
) (i1,i2,i3,i4 bar i5 i6

(30 ;(drowpoly(d,p

: d
: P
:
;{Int p[8]={100,100,200,100,150,150,100,100
;( Drawpoly(4,p

(31 ;(fillpoly(I,p

i
p
pattern

(32

<include<graphics.h#
<include<stdio.h#
()Void main
}
;int gd=0,md=0
;("".initgraph(&gd,&gm
;{int p1[8]={ 100,100,300,100,200,200,100,100
;{int p2[8]={150,120,250,120,200,170,150,120
;()clrscr
;(setcolor(WHITE
;(setbkcolor(BLACK
;(rectangle(100,100,300,200
;()getch
;(setfillstyle(4,3
;(bar(100,100,300,200
;()getch
;(setfillstyle(4,3
;(bar3d(210,270,200,15,1
;()getch
;(outtex(s
;()closegraph
{

10

(33 ;(oyttextxy(x,y,s


) (x,y
S

(34 ;(settextstyle(font,vethor,size


Font font (1..9
Vethor
Size
;(settextstyle(1,0,5 :
;(" Outtext("HELLO

(35 ;(moveto(x,y

) (x,y
;(moveto(80,120 :

<include<graphics.h#
<include<stdio.h#
()Void main
(36 ;(moverel(x,y
}
;int gd=0,gm=0
;("",initgraph(&gd,&gm
x y ) (a,b
;(setcolor(15
;(setbkcolor(0
) (a+x,b+y
;()cleardevice
;(moverel(,10 :
} (for(int v=0;v<1;++v
} (for( int i=0;i<4;++i
;(settextstyle(i,v,2
:
;("outtextxy(150+i*30,100+i*50,"HELLO
{
;()getch
11
;()closegraph
{

12

:
(void installmouse(void
}
} asm
mov ax,00
int 33H
{
{

(void showmouse(void
}
} asm
mov ax,01
int 33H
{
{

(void hidemouse(void
}
} asm
mov ax,02
int 33H
{
{

13

x
(int getxmouse(void
}
;char I
} asm
mov ax,05
int 33H
mov I,cx
{
;return I
{
y
(int getymouse(void
}
;char I
} asm
mov ax,05
int 33H
mov I,dx
{
;return I
{

(int geteventmouse(void
}
;char I
} asm
mov ax,05
int 33H
mov I,bx
{
;return I
{

14

15

You might also like