最佳答案:
textheight,返回以像素为单位的字符串高度。
详情介绍
textheight,返回以像素为单位的字符串高度。

- 中文名
- textheight
- 外文名
- textheight
- 功 能
- 返回以像素为单位的字符串高度
textheight定义
函数名: textheight
textheight性质
功 能:
textheight应用
用 法: int far textheight(char far *textstring);
程序例:
#include<graphics.h>
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
int y = 0;
int i;
char msg;
initgraph(&gdriver, &gmode, "");
errorcode = graphresult();

if (errorcode != grOk)
{
printf("Graphics error: %sn", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
for (i=1; i<11; i++)
{
settextstyle(TRIPLEX_FONT, HORIZ_DIR, i);
sprintf(msg, "Size: %d", i);
outtextxy(1, y, msg);
y += textheight(msg);
}

getch();
closegraph();
return 0;
}


