ݺߣ

ݺߣShare a Scribd company logo
????? ???????(2??? )????????? ?????????? ????????? ???????C??????????Turbo CPP 3.0
:???????? ???????? ?????12/11/2007
????????? ???? ?????? ??????? ???????
?????? ???????
TURBO?C?PLUS?PLUS?3.0 ??????????
???????? ???????? ????? ???????? :???????
??????? / ????????
? ??????2007,???????? ??????? ??????SBR
Software?Bara?Ramli?(SBR)
?????? ????? ?????? ???? ???????? ????? ????? ???????? ?????? ???
.???????? ????
?????????? ?????? ???? ???????? ??? ??????? ?????? ???????
?????? ???????? ??????? ??? ?????? , )??????? ?(?????? ????????
.??????? ???????? ???????? ??????? ??????? ?????? ????? ????
???? ????? ???? ???? ????? ???????? ????? ?????? :????????
.??????????? ?????? ???? ???????
All programs in this book is free software:
you ca n re dis tr ibu te it and/ or mod ify it unde r th e te rms of th e GNU Ge ne ra l Public Licen se
as publ ish ed by the Free Sof tw ar e Fo un da ti on , ei th er ver si on 3 of th e Lic en se, any lat er
ver si on .
Thi s prog ram is dist ri but ed in th e ho pe th at it wi ll be u se fu l, but W ITHO UT AN Y
WARRA NT Y; wit ho ut eve n th e im plie d warr an ty of
ME RCH AN TA BI LIT Y or FI TN ESS FOR A PART ICUL AR PURPOS E.
Se e th e GNU Ge ne ra l P ublic Lice nse for more det ails .
Yo u sh ou ld hav e re ce iv ed a cop y of th e GN U Ge ne ra l Publi c Lic en se
alon g w ith t his prog ram . If not , see <http://www.gnu.org/licenses/>.
??????? ???????? ?????
???????
????? ???????? ??????? ??????? ?????? ??????? ??????
??????? ??????? ????? ???? ???????? ????? ??????? ?????????
???????graphics.h
???? ????? ???????? ?????? ????? ???? ?????? ???? ?????? ??????
.???????? ?????????? ????????? ????????? ???????
???? ??????? , ?????????? ?????????? ?????????? :????????
.)?(????????? ?????? ???? ????????
?????????? ??????????? ????????? ???? ????? ?????? ???? ???????
,????????? ??????? ????? ??????? ?????? ??? , ????????? ????? ????
????? ????? ????? ????? ??????? ???????? ????? ????? ??????
??????? ?????? ????? ????? ????? ????? , ????????? ?????????
?????? ???? ????? ??????? ????? ????? ?????? ????? ????? ???? ???????
???????? ???? ???? ????? , ??????? ????? ????????? ?????? ????????
.??????? ????? ?????? ??????? ????? , ??????????
???????? ???????? ????? ????????
opencpp@yahoo.com
??????/??????
:??????? ??????? ???????www.khayma.com/opencpp
???????????
????????
???????? ????????
??????? ???? ?????????? ??????? ?????? /?????? ???????graphics.h
?????????? ???????? /???????? ???????
?????????? ???????? ??????? /???????? ???????
???????? ????????
???????TURBO CPP 3.0??????? ????????
????? ??????Options????Linker????Libraries
??????Graphics library?????? ????ok
??????? ?????? ?????
:?????? ???? ?????
1.????? ??????? ?????? ???????? ????640( ??????pixel????? ???????? )470( ??????pixel??????? ,)
= ???????? ?????480640
2.( ??????pixel( ????????? ??????? ????? ???????? ????? ????????? ?????? ?????? ?????? ???? )picture
cell).
3..???????? ?????? ??????? ??????? ???? ????? ?????? ??????
4.?(????? ??????? ????????X.???????? ????? ???????? ???? ??????? )
5.?(????? ???????? ????????Y.?????? ????? ?????? ???? ??????? )
:????????
????????? ?????? ???? ????????? ??????VGA?????? ???? ?????? ???? ??????? ????? ????? ?????? ????????? ?????? ,
.????????
/?????? ???????
??????? ???? ??????? ??????graphics
??????? ???????? ??????? ???????
:????? ???????? ???? ???? ???????? ????????? ???????? ??????? ?????
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
void main)(
{
int gdriver = DETECT, gmode,
errorcode;
initgraph)&gdriver, &gmode,
"c:tcbgi"(;
.
.
.
(????? ?????? ??????? ?)?????
.
.
.
getch)(;
}
??????? ??????? ?????????
??????? ?????? ????? ???????? ??????
?????????
???????? ????? ????????? ???????
????????? ????? ?????? ???????? ??????
?????????? ??????? ?????? ???? ?.???????
??????? ????? ??????? ????? :???????
c:tcbgi
?????? ????? ?????TURBO
C.??????? ??????? ???? ++
?????? ???????? ????? ???????? ???????
???? ???? ????? ???????
??????? ???? ?????????? )??????? ?(????? ???????? ???????graphics.h?????83.??????
????? ?????????? ???????? ??????? )????????? ?????? ?(??????? ???????? ???? ?????????? ????????35??????
arc imagesize
bar initgraph
bar3d installuserdriver
circle installuserfont
cleardevice line
clearviewport linerel
closegraph lineto
detectgraph moverel
drawpoly moveto
ellipse outtext
fillellipse outtextxy
fillpoly pieslice
floodfill putimage
getarccoords putpixel
getaspectratio rectangle
getbkcolor registerbgidriver
getcolor registerfarbgidriver
getdefaultpalette registerbgifont
getdrivername registerfarbgifont
getfillpattern restorecrtmode
getfillsettings sector
getgraphmode setactivepage
getimage setallpalette
getlinesettings setaspectratio
getmaxcolor setbkcolor
getmaxmode setcolor
getmaxx setfillpattern
getmaxy setfillstyle
getmodename setgraphbufsize
getmoderange setgraphmode
getpalette setlinestyle
getpalettesize setpalette
getpixel setrgbpalette
gettextsettings settextjustify
getviewsettings settextstyle
getx setusercharsize
gety setviewport
graphdefaults setvisualpage
grapherrormsg setwritemode
_graphfreemem textheight
_graphgetmem textwidth
graphresult
???????? ??????? ?????? ?????
/????????? ????? ????? ??????? ????? ???? ???????? ??????closegraph
.??????? ???????? ??????? ????? ?????? ??????? ,????????? ????????? ??????? ????? ????????? ??????? ??????? ??????? ??????
Closegraph)(;
???????? ????? ?????
initgraph)&gdriver, &gmode, "c:tcbgi"(;
.??????? ??????? ?????? ?????? ??????
/???????? ????? ??????cleardevice
:???????? ????? ???????? ???????? ????? ???????
cleardevice )(;
?????? ??????? ?????
clrscr)(;
???? ????? ????????? ????????? ?????? ?(???? :????? ?????? ??????clrscr.)??????? ?????? ???? ???????? ???
/???????? ?????? ???????? ?????? ????? ???????? ??????getmaxx
??????? ????? ,???????? ????? ???????? ?????????? ?????? ?????? ???????? ??????640.
( ????? ???????? ?????? :???????640???????? ????????? ???????? )m.??????
m=getmaxx)(;
???????? ?????? ???????? ?????? ????? ???????? ??????/getmaxy
??????? ????? ,???????? ????? ???????? ?????????? ?????? ?????? ??????? ??????480.
( ????? ???????? ?????? :???????480???????? ????????? ???????? )m.??????
m=getmaxy)(;
/???????? ???????
?????????? ????????
/???????? ???? ????? ??????line
????? ???????4( ??????? ???????? ???????? :???? ??????? ?????????x1,y1???????? ???????? ????????? )
(x2,y2.)
.??????? ?????? ???? ??????? ????????? ??????????? ?????? ???? ?????? :????????
line)x1,y1,x2,y2(;
?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ?????????
#include?<stdio.h>
#include <conio.h>
#include <graphics.h>
void main)(
{
int x1=50 ,y1=20;
int x2=200,y2=100;
int gdriver = DETECT, gmode, errorcode;
initgraph)&gdriver, &gmode, "c:tcbgi"(;
line)x1,y1,x2,y2(;
getch)(;
}
/??????? ????? ??????circle
????? ???????3( ???????? ???????? :???? ??????? ?????????x,y??????? ?????? )r.
?????? ???? ?????? :????????x,y,z.??????? ?????? ???? ??????? ?????????
circle)x,y,r(;
?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ?????????
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
void main)(
{
int x=150,y=80,r=10;
int gdriver = DETECT, gmode, errorcode;
initgraph)&gdriver, &gmode,
"c:tcbgi"(;
circle)x,y,r(;
getch)(;
}
/?????? ????? ??????putpixel
????? ???????3( ???????? ???????? :???? ??????? ?????????x1,y1?????? ???????? )h,???????? ????? ????????
???? ??????? ???????? ,???????? ???????? ???? ??????? ?????0?????15.
.)??????? ??????? ?(????? ?????? ???????? ????? ?????? ??????? ????? ?????? ????? ???????? ?????? ?????
.??????? ?????? ???? ??????? ????????? )???????? ?(????????? ?????? ???? ?????? :????????
Putpixel)x,y,h(;
?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ?????????
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
void main)(
{
int x=45,y=60,h=15;
int gdriver = DETECT, gmode, errorcode;
initgraph)&gdriver, &gmode,
"c:tcbgi"(;
putpixel)x,y,h(;
getch)(;
}
/???????? ??????? ????? ??????arc
)midx, midy(=???????? ????????
stangle= ) 1( ??????? ???????
endangle= ) 2( ????????? ???????
radius=??????? ?????
arc)midx, midy, stangle, endangle, radius(;
?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ?????????
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
void main)(
{
int midx=320, midy=240, stangle = 45;
int endangle = 135, radius = 100;
int gdriver = DETECT, gmode, errorcode;
initgraph)&gdriver, &gmode, "c:tcbgi"(;
arc)midx, midy, stangle, endangle, radius(;
getch)(;
}
/?????? ????? ????? ??????ellipse
)midx, midy(=???????? ????????
stangle= ) 1( ??????? ???????
endangle= ) 2( ????????? ???????
xradius= x ????????? ????? ?????
yradius= y ????????? ????? ?????
ellipse)midx, midy, stangle, endangle, xradius, yradius(;
?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ?????????
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
void main)(
{
int midx=320, midy=240, stangle = ?45;
int endangle = 180, xradius = 70, yradius = 30;
int gdriver = DETECT, gmode, errorcode;
initgraph)&gdriver, &gmode, "c:tcbgi"(;
ellipse )midx, midy, stangle, endangle,xradius,yradius(;
getch)(;
}
/???????? ????? ??????rectangle
??????????????? ???????(=A,B)
??????? ??????? ????????=(W,Z)
rectangle)A,B,W,Z(;
?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ?????????
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
void main)(
{
int a=10,b=20,w=150,z=200;
int gdriver = DETECT, gmode, errorcode;
initgraph)&gdriver, &gmode, "c:tcbgi"(;
rectangle)a,b,w,z(;
getch)(;
}
/????????? ???????? ????? ??????drawpoly
???? ???????? ???????? ?????p????? ????? ????????n.???????? ????
drawpoly)n,p(;
?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ?????????
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
void main)(
{
int p[6];
int gdriver = DETECT, gmode, errorcode;
initgraph)&gdriver, &gmode,
"c:tcbgi"(;
p[0]=10;p[1]=15;
p[2]=100;p[3]=200;
p[4]=200;p[5]=250;
drawpoly)3,p(;
getch)(;
}
/???????? ???????
?????????? ???????? ???????
/ ??????? ???? ????? ??????? ??????setlinestyle
:????? ?????????? ???????? ??????? ?????? ????? ??????? ???????
a???? ?????? ?????1?????4. ?????? ?????? ???????
b???? ?????? ?????0?????12.??????? ?????? ???????
c????? ?????? ?????1???? ?????? ????3.?????? ????
Setlinestyle)a,b,c(;
:????????,)??????? ?(????? ????? )???????? ?(???? ?????? ???? ?????.????????? ?????? ??????? ??????? ????? ????? ??????? ?????? ?????? ???????? ???? ??????
/??????? ????? ?????? ??????Setcolor
???????? ?????????? ??????? ????? ??????? ???????setcolor???????? ?????? ????? ??????? ????? ???????? ??????
:???????? ???????? ????
setcolor) 15 (;
012345
??????????????????????????????????????
67891011
??????????? ????????????? ????????????? ???????????? ???????????? ??????
12131415
?????? ???????????? ????????????????????
:????????,)??????? ?(????? ????? )???????? ?(???? ?????? ???? ?????.????????? ?????? ??????? ??????? ????? ????? ??????? ?????? ?????? ???????? ???? ??????
/???????? ??????? ????? ?????? ??????setbkcolor
???????? ?????????? ????????? ????? ??????? ???????setbkcolor?????? ????? ??????? ????? ???????? ??????
:???????? ???????? ???? ????????
setbkcolor) 4 (;
:????????,)??????? ?(????? ????? )???????? ?(???? ?????? ???? ?????.????????? ?????? ??????? ????????? ????? ????? ??????? ?????? ?????? ???????? ???? ??????
/????????? ????? ????? ???????? ??????getbkcolor
.????????? ?????? ????????? ???????? ????? ???????? ???? ???????
( ????? ???????? ?????? ?????? ,??????? ???? ????????? ????? ????? ???? :??????0????????? ???????? )m.)?????? :)
m=getbkcolor)(;
/??????? ???? ????? ????? ???????? ??????getcolor
.??????? ?????? ????????? ???????? ????? ???????? ???? ???????
( ????? ???????? ?????? ?????? ,??????? ???? ??????? ????? ????? ???? :??????5????????? ???????? )m.)?????? :)
m=getcolor)(;
/?????????? ???????? ???????? ??????floodfill????????? ?????? ????? ???????? ???????setfillstyle
?????A??????? ????????? ????? ????SOILD_FILL."??????? ??????? ????? ?"???? ????????? ??????
setfillstyle)SOLID_FILL,A(;
.???????? ???????? ????? ????? ???????? ???????? ??????? ????? ????? :???????
???????? ?????????? ??????? ?????? ??????? ????? ?????? ????? ????? ?????floodfill
( ????? ,?????? ????? ?????? ??????? ?????G,F.???????? ??????? ?????? ????? ?????? ?????????? )
???????C.???????? ??????? ???? ???????? ??????? ?????? ????? ????
floodfill)G,F,C(;
....??????????? ????????? ????????? ????????? :????? ????????? ?????????? ???????? ???????? ???????? ????? ????????
.????????? ???????? ??????? ????? ????????? ???????? ????? ???? ??????????? ???????
.)??????? ?(????? ????? )???????? ?(???? ?????? ???? ????? :???????
/???????? ??????? ???? ????? ????? ????? ???????? ??????getmaxcolor
?????? ?????? ,??????? ???? ??????? ????? ????? ???? :?????? ,????? ????? ????????? ???????? ????? ???????? ???? ???????
( ????? ????????15????????? ???????? )m.)?????? :)
m=getmaxcolor)(;
.????????? ???????? ?????? ???????? :??????
:?????????? ??????? ?????
?????????????????? ??????? ???????(=A,B)
?????????? ??????? ??????? ????????=(W,Z)
???????? ????????????????? ?????? ??????(=G,F)
?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ?????????
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
void main)(
{
int
a=100,b=200,w=200,z=300,G=150,F=250;
int gdriver = DETECT, gmode, errorcode;
initgraph)&gdriver, &gmode, "c:tcbgi"(;
setfillstyle)SOLID_FILL,14(;
setcolor)15(;
rectangle)a,b,w,z(;
floodfill)G,F,15(;
getch)(;
}
???????? ??????? ??????

More Related Content

Similar to ????? ?????? ???? ???? ??? ??? ??????? ??????? (20)

????? ????1
????? ????1????? ????1
????? ????1
jadalkinani1
?
????? ????1
????? ????1????? ????1
????? ????1
jadalkinani1
?
????? ???? ??????? ???? C / C++ - 1
????? ???? ??????? ???? C / C++  - 1????? ???? ??????? ???? C / C++  - 1
????? ???? ??????? ???? C / C++ - 1
???? ???????
?
1- Languages Basics
1- Languages Basics1- Languages Basics
1- Languages Basics
Ghadeer AlHasan
?
????? ?????? ?? ???? ???? ?????? ???????? Visual Basic.Net 2005
????? ?????? ?? ???? ???? ?????? ???????? Visual Basic.Net 2005????? ?????? ?? ???? ???? ?????? ???????? Visual Basic.Net 2005
????? ?????? ?? ???? ???? ?????? ???????? Visual Basic.Net 2005
Hanaa Ahmed
?
14th session python fifth gui
14th session python   fifth gui14th session python   fifth gui
14th session python fifth gui
AliMohammad155
?
7 functions
7 functions7 functions
7 functions
Bint EL-maghrabi
?
???? ??????? ??????? - 1377
???? ??????? ??????? - 1377???? ??????? ??????? - 1377
???? ??????? ??????? - 1377
????? ????? ????????
?
???? ???? ??????? ????? ?? ???? ?? ??? ????.pdf
???? ???? ??????? ????? ?? ???? ?? ??? ????.pdf???? ???? ??????? ????? ?? ???? ?? ??? ????.pdf
???? ???? ??????? ????? ?? ???? ?? ??? ????.pdf
NadiaMohamedSherif
?
Raspberrypi ????? ??????? ??? ?????? ????????
 Raspberrypi  ????? ??????? ??? ?????? ???????? Raspberrypi  ????? ??????? ??? ?????? ????????
Raspberrypi ????? ??????? ??? ?????? ????????
Abdalwahab Noureldien
?
C++ function (1) c++2
C++ function (1) c++2C++ function (1) c++2
C++ function (1) c++2
MohammedDoos
?
?????? ?????? ????? ???? ????
?????? ?????? ????? ???? ?????????? ?????? ????? ???? ????
?????? ?????? ????? ???? ????
Aml Sindi
?
??????? | ???? ?????? ????? ?????? ?? ????????..????? ??? ????????
??????? | ???? ?????? ????? ?????? ?? ????????..????? ??? ??????????????? | ???? ?????? ????? ?????? ?? ????????..????? ??? ????????
??????? | ???? ?????? ????? ?????? ?? ????????..????? ??? ????????
Mohamed E. Saleh
?

????? ?????? ???? ???? ??? ??? ??????? ???????

  • 1. ????? ???????(2??? )????????? ?????????? ????????? ???????C??????????Turbo CPP 3.0 :???????? ???????? ?????12/11/2007 ????????? ???? ?????? ??????? ??????? ?????? ??????? TURBO?C?PLUS?PLUS?3.0 ?????????? ???????? ???????? ????? ???????? :??????? ??????? / ????????
  • 2. ? ??????2007,???????? ??????? ??????SBR Software?Bara?Ramli?(SBR) ?????? ????? ?????? ???? ???????? ????? ????? ???????? ?????? ??? .???????? ???? ?????????? ?????? ???? ???????? ??? ??????? ?????? ??????? ?????? ???????? ??????? ??? ?????? , )??????? ?(?????? ???????? .??????? ???????? ???????? ??????? ??????? ?????? ????? ???? ???? ????? ???? ???? ????? ???????? ????? ?????? :???????? .??????????? ?????? ???? ??????? All programs in this book is free software: you ca n re dis tr ibu te it and/ or mod ify it unde r th e te rms of th e GNU Ge ne ra l Public Licen se as publ ish ed by the Free Sof tw ar e Fo un da ti on , ei th er ver si on 3 of th e Lic en se, any lat er ver si on . Thi s prog ram is dist ri but ed in th e ho pe th at it wi ll be u se fu l, but W ITHO UT AN Y WARRA NT Y; wit ho ut eve n th e im plie d warr an ty of ME RCH AN TA BI LIT Y or FI TN ESS FOR A PART ICUL AR PURPOS E. Se e th e GNU Ge ne ra l P ublic Lice nse for more det ails . Yo u sh ou ld hav e re ce iv ed a cop y of th e GN U Ge ne ra l Publi c Lic en se alon g w ith t his prog ram . If not , see <http://www.gnu.org/licenses/>.
  • 3. ??????? ???????? ????? ??????? ????? ???????? ??????? ??????? ?????? ??????? ?????? ??????? ??????? ????? ???? ???????? ????? ??????? ????????? ???????graphics.h ???? ????? ???????? ?????? ????? ???? ?????? ???? ?????? ?????? .???????? ?????????? ????????? ????????? ??????? ???? ??????? , ?????????? ?????????? ?????????? :???????? .)?(????????? ?????? ???? ???????? ?????????? ??????????? ????????? ???? ????? ?????? ???? ??????? ,????????? ??????? ????? ??????? ?????? ??? , ????????? ????? ???? ????? ????? ????? ????? ??????? ???????? ????? ????? ?????? ??????? ?????? ????? ????? ????? ????? , ????????? ????????? ?????? ???? ????? ??????? ????? ????? ?????? ????? ????? ???? ??????? ???????? ???? ???? ????? , ??????? ????? ????????? ?????? ???????? .??????? ????? ?????? ??????? ????? , ?????????? ???????? ???????? ????? ???????? opencpp@yahoo.com ??????/?????? :??????? ??????? ???????www.khayma.com/opencpp
  • 4. ??????????? ???????? ???????? ???????? ??????? ???? ?????????? ??????? ?????? /?????? ???????graphics.h ?????????? ???????? /???????? ??????? ?????????? ???????? ??????? /???????? ???????
  • 6. ???????TURBO CPP 3.0??????? ???????? ????? ??????Options????Linker????Libraries ??????Graphics library?????? ????ok
  • 7. ??????? ?????? ????? :?????? ???? ????? 1.????? ??????? ?????? ???????? ????640( ??????pixel????? ???????? )470( ??????pixel??????? ,) = ???????? ?????480640 2.( ??????pixel( ????????? ??????? ????? ???????? ????? ????????? ?????? ?????? ?????? ???? )picture cell). 3..???????? ?????? ??????? ??????? ???? ????? ?????? ?????? 4.?(????? ??????? ????????X.???????? ????? ???????? ???? ??????? ) 5.?(????? ???????? ????????Y.?????? ????? ?????? ???? ??????? ) :???????? ????????? ?????? ???? ????????? ??????VGA?????? ???? ?????? ???? ??????? ????? ????? ?????? ????????? ?????? , .????????
  • 8. /?????? ??????? ??????? ???? ??????? ??????graphics
  • 9. ??????? ???????? ??????? ??????? :????? ???????? ???? ???? ???????? ????????? ???????? ??????? ????? #include <stdio.h> #include <conio.h> #include <graphics.h> void main)( { int gdriver = DETECT, gmode, errorcode; initgraph)&gdriver, &gmode, "c:tcbgi"(; . . . (????? ?????? ??????? ?)????? . . . getch)(; } ??????? ??????? ????????? ??????? ?????? ????? ???????? ?????? ????????? ???????? ????? ????????? ??????? ????????? ????? ?????? ???????? ?????? ?????????? ??????? ?????? ???? ?.??????? ??????? ????? ??????? ????? :??????? c:tcbgi ?????? ????? ?????TURBO C.??????? ??????? ???? ++ ?????? ???????? ????? ???????? ??????? ???? ???? ????? ???????
  • 10. ??????? ???? ?????????? )??????? ?(????? ???????? ???????graphics.h?????83.?????? ????? ?????????? ???????? ??????? )????????? ?????? ?(??????? ???????? ???? ?????????? ????????35?????? arc imagesize bar initgraph bar3d installuserdriver circle installuserfont cleardevice line clearviewport linerel closegraph lineto detectgraph moverel drawpoly moveto ellipse outtext fillellipse outtextxy fillpoly pieslice floodfill putimage getarccoords putpixel getaspectratio rectangle getbkcolor registerbgidriver getcolor registerfarbgidriver getdefaultpalette registerbgifont getdrivername registerfarbgifont getfillpattern restorecrtmode getfillsettings sector getgraphmode setactivepage getimage setallpalette getlinesettings setaspectratio getmaxcolor setbkcolor getmaxmode setcolor getmaxx setfillpattern getmaxy setfillstyle getmodename setgraphbufsize getmoderange setgraphmode getpalette setlinestyle getpalettesize setpalette getpixel setrgbpalette gettextsettings settextjustify getviewsettings settextstyle getx setusercharsize gety setviewport graphdefaults setvisualpage grapherrormsg setwritemode _graphfreemem textheight _graphgetmem textwidth graphresult
  • 11. ???????? ??????? ?????? ????? /????????? ????? ????? ??????? ????? ???? ???????? ??????closegraph .??????? ???????? ??????? ????? ?????? ??????? ,????????? ????????? ??????? ????? ????????? ??????? ??????? ??????? ?????? Closegraph)(; ???????? ????? ????? initgraph)&gdriver, &gmode, "c:tcbgi"(; .??????? ??????? ?????? ?????? ?????? /???????? ????? ??????cleardevice :???????? ????? ???????? ???????? ????? ??????? cleardevice )(; ?????? ??????? ????? clrscr)(; ???? ????? ????????? ????????? ?????? ?(???? :????? ?????? ??????clrscr.)??????? ?????? ???? ???????? ??? /???????? ?????? ???????? ?????? ????? ???????? ??????getmaxx ??????? ????? ,???????? ????? ???????? ?????????? ?????? ?????? ???????? ??????640. ( ????? ???????? ?????? :???????640???????? ????????? ???????? )m.?????? m=getmaxx)(; ???????? ?????? ???????? ?????? ????? ???????? ??????/getmaxy ??????? ????? ,???????? ????? ???????? ?????????? ?????? ?????? ??????? ??????480. ( ????? ???????? ?????? :???????480???????? ????????? ???????? )m.?????? m=getmaxy)(;
  • 13. /???????? ???? ????? ??????line ????? ???????4( ??????? ???????? ???????? :???? ??????? ?????????x1,y1???????? ???????? ????????? ) (x2,y2.) .??????? ?????? ???? ??????? ????????? ??????????? ?????? ???? ?????? :???????? line)x1,y1,x2,y2(; ?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ????????? #include?<stdio.h> #include <conio.h> #include <graphics.h> void main)( { int x1=50 ,y1=20; int x2=200,y2=100; int gdriver = DETECT, gmode, errorcode; initgraph)&gdriver, &gmode, "c:tcbgi"(; line)x1,y1,x2,y2(; getch)(; }
  • 14. /??????? ????? ??????circle ????? ???????3( ???????? ???????? :???? ??????? ?????????x,y??????? ?????? )r. ?????? ???? ?????? :????????x,y,z.??????? ?????? ???? ??????? ????????? circle)x,y,r(; ?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ????????? #include <stdio.h> #include <conio.h> #include <graphics.h> void main)( { int x=150,y=80,r=10; int gdriver = DETECT, gmode, errorcode; initgraph)&gdriver, &gmode, "c:tcbgi"(; circle)x,y,r(; getch)(; }
  • 15. /?????? ????? ??????putpixel ????? ???????3( ???????? ???????? :???? ??????? ?????????x1,y1?????? ???????? )h,???????? ????? ???????? ???? ??????? ???????? ,???????? ???????? ???? ??????? ?????0?????15. .)??????? ??????? ?(????? ?????? ???????? ????? ?????? ??????? ????? ?????? ????? ???????? ?????? ????? .??????? ?????? ???? ??????? ????????? )???????? ?(????????? ?????? ???? ?????? :???????? Putpixel)x,y,h(; ?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ????????? #include <stdio.h> #include <conio.h> #include <graphics.h> void main)( { int x=45,y=60,h=15; int gdriver = DETECT, gmode, errorcode; initgraph)&gdriver, &gmode, "c:tcbgi"(; putpixel)x,y,h(; getch)(; }
  • 16. /???????? ??????? ????? ??????arc )midx, midy(=???????? ???????? stangle= ) 1( ??????? ??????? endangle= ) 2( ????????? ??????? radius=??????? ????? arc)midx, midy, stangle, endangle, radius(; ?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ????????? #include <stdio.h> #include <conio.h> #include <graphics.h> void main)( { int midx=320, midy=240, stangle = 45; int endangle = 135, radius = 100; int gdriver = DETECT, gmode, errorcode; initgraph)&gdriver, &gmode, "c:tcbgi"(; arc)midx, midy, stangle, endangle, radius(; getch)(; }
  • 17. /?????? ????? ????? ??????ellipse )midx, midy(=???????? ???????? stangle= ) 1( ??????? ??????? endangle= ) 2( ????????? ??????? xradius= x ????????? ????? ????? yradius= y ????????? ????? ????? ellipse)midx, midy, stangle, endangle, xradius, yradius(; ?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ????????? #include <stdio.h> #include <conio.h> #include <graphics.h> void main)( { int midx=320, midy=240, stangle = ?45; int endangle = 180, xradius = 70, yradius = 30; int gdriver = DETECT, gmode, errorcode; initgraph)&gdriver, &gmode, "c:tcbgi"(; ellipse )midx, midy, stangle, endangle,xradius,yradius(; getch)(; }
  • 18. /???????? ????? ??????rectangle ??????????????? ???????(=A,B) ??????? ??????? ????????=(W,Z) rectangle)A,B,W,Z(; ?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ????????? #include <stdio.h> #include <conio.h> #include <graphics.h> void main)( { int a=10,b=20,w=150,z=200; int gdriver = DETECT, gmode, errorcode; initgraph)&gdriver, &gmode, "c:tcbgi"(; rectangle)a,b,w,z(; getch)(; }
  • 19. /????????? ???????? ????? ??????drawpoly ???? ???????? ???????? ?????p????? ????? ????????n.???????? ???? drawpoly)n,p(; ?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ????????? #include <stdio.h> #include <conio.h> #include <graphics.h> void main)( { int p[6]; int gdriver = DETECT, gmode, errorcode; initgraph)&gdriver, &gmode, "c:tcbgi"(; p[0]=10;p[1]=15; p[2]=100;p[3]=200; p[4]=200;p[5]=250; drawpoly)3,p(; getch)(; }
  • 21. / ??????? ???? ????? ??????? ??????setlinestyle :????? ?????????? ???????? ??????? ?????? ????? ??????? ??????? a???? ?????? ?????1?????4. ?????? ?????? ??????? b???? ?????? ?????0?????12.??????? ?????? ??????? c????? ?????? ?????1???? ?????? ????3.?????? ???? Setlinestyle)a,b,c(; :????????,)??????? ?(????? ????? )???????? ?(???? ?????? ???? ?????.????????? ?????? ??????? ??????? ????? ????? ??????? ?????? ?????? ???????? ???? ?????? /??????? ????? ?????? ??????Setcolor ???????? ?????????? ??????? ????? ??????? ???????setcolor???????? ?????? ????? ??????? ????? ???????? ?????? :???????? ???????? ???? setcolor) 15 (; 012345 ?????????????????????????????????????? 67891011 ??????????? ????????????? ????????????? ???????????? ???????????? ?????? 12131415 ?????? ???????????? ???????????????????? :????????,)??????? ?(????? ????? )???????? ?(???? ?????? ???? ?????.????????? ?????? ??????? ??????? ????? ????? ??????? ?????? ?????? ???????? ???? ?????? /???????? ??????? ????? ?????? ??????setbkcolor ???????? ?????????? ????????? ????? ??????? ???????setbkcolor?????? ????? ??????? ????? ???????? ?????? :???????? ???????? ???? ???????? setbkcolor) 4 (; :????????,)??????? ?(????? ????? )???????? ?(???? ?????? ???? ?????.????????? ?????? ??????? ????????? ????? ????? ??????? ?????? ?????? ???????? ???? ?????? /????????? ????? ????? ???????? ??????getbkcolor .????????? ?????? ????????? ???????? ????? ???????? ???? ??????? ( ????? ???????? ?????? ?????? ,??????? ???? ????????? ????? ????? ???? :??????0????????? ???????? )m.)?????? :) m=getbkcolor)(;
  • 22. /??????? ???? ????? ????? ???????? ??????getcolor .??????? ?????? ????????? ???????? ????? ???????? ???? ??????? ( ????? ???????? ?????? ?????? ,??????? ???? ??????? ????? ????? ???? :??????5????????? ???????? )m.)?????? :) m=getcolor)(; /?????????? ???????? ???????? ??????floodfill????????? ?????? ????? ???????? ???????setfillstyle ?????A??????? ????????? ????? ????SOILD_FILL."??????? ??????? ????? ?"???? ????????? ?????? setfillstyle)SOLID_FILL,A(; .???????? ???????? ????? ????? ???????? ???????? ??????? ????? ????? :??????? ???????? ?????????? ??????? ?????? ??????? ????? ?????? ????? ????? ?????floodfill ( ????? ,?????? ????? ?????? ??????? ?????G,F.???????? ??????? ?????? ????? ?????? ?????????? ) ???????C.???????? ??????? ???? ???????? ??????? ?????? ????? ???? floodfill)G,F,C(; ....??????????? ????????? ????????? ????????? :????? ????????? ?????????? ???????? ???????? ???????? ????? ???????? .????????? ???????? ??????? ????? ????????? ???????? ????? ???? ??????????? ??????? .)??????? ?(????? ????? )???????? ?(???? ?????? ???? ????? :??????? /???????? ??????? ???? ????? ????? ????? ???????? ??????getmaxcolor ?????? ?????? ,??????? ???? ??????? ????? ????? ???? :?????? ,????? ????? ????????? ???????? ????? ???????? ???? ??????? ( ????? ????????15????????? ???????? )m.)?????? :) m=getmaxcolor)(;
  • 23. .????????? ???????? ?????? ???????? :?????? :?????????? ??????? ????? ?????????????????? ??????? ???????(=A,B) ?????????? ??????? ??????? ????????=(W,Z) ???????? ????????????????? ?????? ??????(=G,F) ?????????? ??????? ????? ???????? ???? ??????? ???? ???? ??????? ???????? ????????? #include <stdio.h> #include <conio.h> #include <graphics.h> void main)( { int a=100,b=200,w=200,z=300,G=150,F=250; int gdriver = DETECT, gmode, errorcode; initgraph)&gdriver, &gmode, "c:tcbgi"(; setfillstyle)SOLID_FILL,14(; setcolor)15(; rectangle)a,b,w,z(; floodfill)G,F,15(; getch)(; } ???????? ??????? ??????