Text.cpp
上传用户:wszmarenbt
上传日期:2013-04-26
资源大小:2552k
文件大小:1k
源码类别:

Windows编程

开发平台:

Visual C++

  1. #include <graphics.h>
  2. #include    <conio.h>
  3. int main(void)
  4. {
  5. int driver=DETECT,mode;
  6. int NUM;
  7. initgraph(&driver,&mode,"d:\tools\tc3.0\bgi");
  8. registerbgidriver(EGAVGA_driver);
  9. registerbgifont(DEFAULT_FONT);
  10. for(NUM=1;NUM<5;NUM++)
  11. {
  12. setcolor(10+NUM);
  13. settextstyle(DEFAULT_FONT,HORIZ_DIR,NUM);
  14. outtextxy(100,100*NUM,"Hello!");
  15. }
  16. setcolor(11);
  17. settextstyle(SMALL_FONT,HORIZ_DIR,4);
  18. outtextxy(300,300,"Hello!");
  19. settextstyle(GOTHIC_FONT,HORIZ_DIR,4);
  20. outtextxy(300,200,"Hello!");
  21. setcolor(10);
  22. settextstyle(DEFAULT_FONT,VERT_DIR,2);
  23. outtextxy(20,10,"* * * Welcome To This System! * * *");
  24. settextstyle(DEFAULT_FONT,VERT_DIR,2);
  25. outtextxy(620,10,"* * * Welcome To This System! * * *");
  26. setcolor(WHITE);
  27. line(20,0,20,479);
  28. line(22,0,22,479);
  29. line(600,0,600,479);
  30. line(602,0,602,479);
  31. getch();
  32. closegraph();
  33. return 0;
  34. }