gui.c
来自「GUI例程」· C语言 代码 · 共 89 行
C
89 行
/* gui.c: Graphics demos * * Programmed By Chen Yang (support@hhcn.com) * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */#include "gui.h"main(int argc,char*argv[]){ short i,j,w,h; PatternIndex p=BlackPattern; char buf[512]; if(initgraph()) { if(argc>1) { ShowBMP(argv[1]); for(i=1;i<160;i++) { V_scroll_screen(1); } ShowBMP(argv[1]); for(i=1;i<160;i++) { V_scroll_screen(-1); } textout(0,0,"Press Enter To Show File."); ShowBMP(argv[1]); for(i=1;i<160;i++) { H_scroll_screen(1); } ShowBMP(argv[1]); for(i=1;i<160;i++) { H_scroll_screen(-1); } } clearscreen(); for(;p<InvalidPattern;p++) { setfillpattern(p); sprintf(buf,"%d",p); textout(120,0,buf); fillrect(0,0,120,120); } clearscreen(); textout(0,0,"华恒科技"); textout(0,20,"HHtech"); /* printf("111111\n"); for(i=0;i<16;i++) memcpy(buf+i*8,0x400+i*20,8); printf("22222222\n"); for(i=0;i<16;i++) memcpy(0x400+320+i*20,buf+i*8,8); printf("33333333\n"); srand(0); for(;;) { i=rand()%160; j=rand()%160; if(i<96) if(j<144) bitblt(0,0,64,16,i,j,buf,8,0x400,20); else if(j>=144) bitblt(0,0,64,159-j,i,j,buf,8,0x400,20); else if(j<144) bitblt(0,0,159-i,j,i,j,buf,8,0x400,20); else if(j>=144) bitblt(0,0,159-i,159-j,i,j,buf,8,0x400,20); } */ closegraph(); } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?