功 能: 返回屏幕的最大x坐标
用 法: int far getmaxx(void);
编译环境: TC/WINTC
程序例:
#include #include
#include
int main(void)
{
/* request auto detection */
int gdriver,gmode,errorcode;
int midx,midy;
char xrange[80],yrange[80];
/* initialize graphics and local variables */
gdriver=DETECT;
initgraph(&gdriver,&gmode,'''');
/* read result of initialization */
errorcode=graphresult();
/* an error occurred */
if(errorcode!=grOk)
{
getch();
exit(1); /* terminate with an error code */
}
midx=getmaxx()/2;
midy=getmaxy()/2;
/* convert max resolution values into strings */
/* display the information */
settextjustify(CENTER_TEXT,CENTER_TEXT);
/* clean upp */
getch();
closegraph();
return 0;
}