gui.c

来自「这是linux下在LCD上显示英文和数字的程序 已经验证是好使的」· C语言 代码 · 共 62 行

C
62
字号
/* 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 <stdio.h>   /* Standard input/output definitions */
#include <string.h>  /* String function definitions */
#include <unistd.h>  /* UNIX standard function definitions */
#include <fcntl.h>   /* File control definitions */
#include <errno.h>   /* Error number definitions */
#include <termios.h> /* POSIX terminal control definitions */
#include<sys/types.h>
#include<sys/stat.h>
#include <stdlib.h>

#include "gui.h"
void delay()		/*延时函数*/
{int i,j;

 for(i=0;i<1000;i++)
  for(j=0;j<7000;j++) {}
 }
main(int argc,char*argv[])
{
   short i,j,w,h;
   struct stat st;
   int color0,filelength;	
   PatternIndex p1=BlackPattern;
   
   /*定义缓冲区,并初始化*/
   char buf[20]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19};
   char buf1[2000000];
   short  *o,*c;
   int *p;
   long *q;
   
   FILE *fp;
  
  /*初始化液晶屏*/
  initgraph();
  clearscreen();
  
  /*画出方框*/
 //fillrect(10,200,100,400);
   
  /*在指定的坐标出显出彩色文本*/
 textout(200,200,"ABCD abcd 640*480\n",0xf800,0x0000); delay(); 



}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?