
常用软件类: |
|杀毒安全 | |联络聊天 | |网络软件 | |多媒体类 | |系统工具 | |图形图像 | |系统工具 | |应用软件 | |行业软件 |
开发设计类: |
|动画制作 | |图像处理 | |3D设计 | |操作系统 | |站长学院 | |网络相关 | |WEB设计 | |数据库类 | |程序开发 |
有关图形屏幕下文本输出和字体字型设置函数的用法请看下例:
#include<graphics.h>
#include<stdio.h>
int main()
{
int i, gdriver, gmode;
char s[30];
gdriver=DETECT;
initgraph(&gdriver, &gmode, "c:\\caic\\bgi");
setbkcolor(BLUE);
cleardevice();
setviewport(100, 100, 540, 380, 1);
/*定义一个图形窗口*/
setfillstyle(1, 2); /*绿色以实填充*/
setcolor(YELLOW);
rectangle(0, 0, 439, 279);
floodfill(50, 50, 14);
setcolor(12);
settextstyle(1, 0, 8);
/*三重笔划字体, 水平放大8倍*/
outtextxy(20, 20, "Good Better");
setcolor(15);
settextstyle(3, 0, 5);
/*无衬笔划字体, 水平放大5倍*/
outtextxy(120, 120, "Good Better");
setcolor(14);
settextstyle(2, 0, 8);
i=620;
sprintf(s, "Your score is %d", i);
/*将数字转化为字符串*/
outtextxy(30, 200, s);
/*指定位置输出字符串*/
setcolor(1);
settextstyle(4, 0, 3);
outtextxy(70, 240, s);
getch();
closegraph();
return 0;
}