.


:




:

































 

 

 

 


int far getmaxx(void); -




Int far getmaxy(void); - .

void far setviewport(int left, int top, int right, int botton, int clip); - .

void far getviewsettings(struct viewporttype far *viewport); - .

Void far moveto(int x, int y); void far moverel(int dx, int dy); - x, y dx, dy.

void far setlinestyle(int linestyle, unsigned upattern, int thickness); - .

i nt far getx(void); - ().

Int far gety(void); - ().

void far clearviewport(void); - .

void far cleardevice(void); - .

int far getmaxcolor(void); - .

void far setpalette(int colornum, int color); - .

void far setbkcolor(int color); - .

unsigned far getpixel(int x, int y); - .

void far putpixel(int x, int y, int color); - .

void far bar(int left, int top, int right, int botton);

void far bar3d(int left, int top, int right, int botton, int depth, int topflag);

void far fillpoly(int numpoints, int far *polypoints);

void far fillelipse(int x, int y, int xradius, int yradius);

void far pielipse(int x, int y, stangle, int endangle, int radius);

void far sector(int x, int y, int stangle, int endangle, int xradius, int yradius);

void far line(int x1, int y1, int x2, int y2);

void far linerel(int dx, int dy);

void far lineto(int x, int y);

void far rectangle(int left, int top, int right, int botton);

void far drawpoly(int numpoints, far *polypoints);

void far circle(int x, int y, int radiuces);

void far arc(int x, int y, int stangle, int endangle, int radius);

void far ellipse(int x, int y, int stangle, int endangle, int xradius, int yradius);

/* ..

,

. .

.

. */

#include <graphics.h>

#include <stdio.h>

#include <stdlib.h>

#include <conio.h>

#include <math.h>

#include <DOS.H>

#define ANGLES 15

#define PIXEL_COUNT 1000

#define DELAY_TIME 100 /* in milliseconds */

char *str[]={"","","","",""," ","","","","","","","","","."};

char st[]="_";

void demo(int x,int y,int size,int color);

void demo1(void);

void main()

{//

int graphdriver=DETECT,graphmode,errorcode;

initgraph(&graphdriver,&graphmode,"");

errorcode = graphresult();

if (errorcode!= grOk)

{ printf("Graphics error: %s\n", grapherrormsg(errorcode));

printf("Press any key to halt:");

getch();

exit(1);

}

//

setcolor(9); //

setlinestyle(0,0,3); //

line(0,0,getmaxx(),0); //

line(0,0,0,getmaxy());

line(getmaxx(),0,getmaxx(),getmaxy());

line(0,getmaxy(),getmaxx(),getmaxy());

setcolor(10); // " 19"

settextstyle(GOTHIC_FONT,HORIZ_DIR,4);

outtextxy(260,10," 19");

demo(320,250,125,11); //

demo1(); // " "

getch();

closegraph(); //

clrscr();

}

 

void demo(int x,int y,int size,int color)

{ setcolor(color);

setlinestyle(0,0,1);

int xx[ANGLES],yy[ANGLES],i,j;

for (i=0;i<=ANGLES-1;i++)

{ xx[i]=x+(int)(cos(i*2*M_PI/ANGLES)*size);

yy[i]=y-(int)(sin(i*2*M_PI/ANGLES)*size);

}

for (i=0;i<=ANGLES-1;i++)

{ for (j=0;j<=ANGLES-1;j++)

if (i!=j)

{ line(xx[i],yy[i],xx[j],yy[j]);

}

}

}

 

void demo1(void)

{ int f1 = installuserfont("rtri.CHR"); //

unsigned int sz;

void far *ptr;

sz=imagesize(10,10,50,50);

ptr=malloc(sz);

getimage(10,10,50,50,ptr);

int size = 2,tt,ff,i;

while(!kbhit())

{ tt=0;

settextstyle(DEFAULT_FONT, HORIZ_DIR, size);

for(i=0; i<3; i++)

{ setcolor(3); outtextxy(260,60,st); delay(90);

setcolor(0); outtextxy(260,60,st); delay(90);

}

setcolor(3); ff=260;

for(i=0; i<15; i++)

{ setcolor(3);

settextstyle(f1, HORIZ_DIR, 4);

outtextxy(260+tt, 50, str[i]);

tt+=textwidth(str[i]);

sound(30); delay(20); nosound();

settextstyle(DEFAULT_FONT, HORIZ_DIR, 2);

outtextxy(260+tt+4, 60, st); delay(40);

setcolor(0);

outtextxy(260+tt+4, 60, st); delay(10);

}

settextstyle(DEFAULT_FONT, HORIZ_DIR, 2);

for(i=1;i<4;i++)

{ setcolor(3); outtextxy(260+tt+4, 60, st); delay(90);

setcolor(0); outtextxy(260+tt+4, 60, st); delay(90);

}

setcolor(3);

ff=tt+260; tt=0;

for(i=14;i>=0;i--)

{ settextstyle(f1, HORIZ_DIR, 4);

tt+=textwidth(str[i]);

sound(30); delay(20); nosound();

putimage(ff-tt, 50, ptr, COPY_PUT);

settextstyle(DEFAULT_FONT, HORIZ_DIR, 2);

setcolor(3); outtextxy(ff-tt-4, 60, st); delay(40);

setcolor(0); outtextxy(ff-tt-4, 60, st); delay(10);

}

}

}

1 .

2 .

3 1:1.

4 . , , .

5 .

6 .

7 .

8 , .

 

19.

19.1.

19.1 -

   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

 

19.1 -

1 , ?

2 ?

3 ?

4 ? ?

5 , , ?

6 ? ?

 

1. . . .: , 1988 - 224 .

2. .., ... : . . 2- . .- .: , 2003.- 600.

3. ., . ++. . / .. - .: - 272.

4. .. ++: .- .: , 2002. 207.

5. ., . . . - 1988 - 198 .

6. .., .. . / . .. - . , 1990 - 384 .

7. .., .. . Turbo C Borland C++. - . . , 1992.

8. . :, , : /., .- .: ,2002 480.

9. ., . . - 2- . - .: , 1992 - 272 .

10. .., .. . - : , 1991.

11. .. /++. : . .: , 2001 464.

12. .. /++. : . .: , 2003 461.

13. .. /++. : . .: , 2007 461.

14. .. /++. : . .: , 2004 461.

15. .. /++. /.: , 2002 464 .

16. . ++/., :, 2000 320.

17. . . .:.,2004 512.

18. .., .., .. ѳ. - : , 1993 - 224 .

19. .., .., .. . . .: , 1992 - 352 .

20. , . . , 1988

21. . / ... 4- . .: . , 2005 704.

22. .. /++. . : , 2003 352.

23. .. : . : , 2006 432.

 





:


: 2016-11-02; !; : 655 |


:

:

, .
==> ...

1866 - | 1666 -


© 2015-2024 lektsii.org - -

: 0.037 .