分享好友 天南地北首页 网站导航

什么是textheight

网友 2023-09-16 17:13 · 头闻号教育培训

最佳答案:

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;

}

免责声明:本平台仅供信息发布交流之途,请谨慎判断信息真伪。如遇虚假诈骗信息,请立即举报

举报
反对 0
打赏 0
更多相关文章

收藏

点赞