資源簡介
RFID圖書館圖書與學員注冊代碼。

代碼片段和文件信息
/********************************************************************
*?文件名??:?gui.c
*?描述????:??LCD的gui接口函數
*?創建人??:云杰
*?QQ??????:494713348
*?電話????:15123350190
*?Email ??:founder_elec@foxmail.com
*?網址????:http://shop66398134.taobao.com
*?時間????:2010年4月10日?
*?版本號??:V0.1.0
*?修改記錄:
*
*********************************************************************/
#include?
#include?
#include?
#include?“lcd.h“
#include?“gui_type.h“
#include?“fontlib.h“
/********************************************************************
*?名稱?:?GUI_DrawRectangle()?
*?功能?:?在一個區域畫一個矩形區域
*?輸入?:?指向一個方塊結構體指針
*?輸出?:?無
***********************************************************************/
void??GUI_DrawRectangle(RECT*?pRect)
{
LINE???????line;
line.color?=?pRect->color;
line.xs?=?pRect->xs;
line.xe?=?pRect->xe;
line.ys?=?pRect->ys;
line.ye?=?pRect->ys;
LcdDrawHVLine(&line);?
line.xe?=?pRect->xs;
line.ye?=?pRect->ye;
LcdDrawHVLine(&line);
line.xs?=?pRect->xe;
line.ys?=?pRect->ye;
LcdDrawHVLine(&line);
line.xe?=?pRect->xe;
line.ye?=?pRect->ys;
LcdDrawHVLine(&line);
}?
/********************************************************************
*?名稱?:?GUI_DrawLine()?
*?功能?:?畫一條直線
*?輸入?:?指向直線LINE結構體指針
*?輸出?:?無
***********************************************************************/
void?GUI_DrawLine(?LINE*?pLine?)
{
s16???dxdye;
u8????x1y1x2y2; ????
POINT?point;
x1?=?pLine->xs;
x2?=?pLine->xe;
y1?=?pLine->ys;
y2?=?pLine->ye;
dx=x2-x1;?
dy=y2-y1;
point.color?=??pLine->color;
????
if(dx>=0)
{
if(dy?>=?0)?//?dy>=0
{
if(dx>=dy)?//?1/8?octant
{
e=dy-dx/2;
while(x1<=x2)
{
point.x?=?x1;
????point.y?=?y1;
LcdDrawPoint(&point);
if(e>0){y1+=1;e-=dx;}
x1+=1;
e+=dy;
}
}
else //?2/8?octant
{
e=dx-dy/2;
while(y1<=y2)
{
point.x?=?x1;
????point.y?=?y1;
LcdDrawPoint(&point);
if(e>0){x1+=1;e-=dy;}
y1+=1;
e+=dx;
}
}
}
else ???//?dy<0
{
dy=-dy;???//?dy=abs(dy)
if(dx>=dy)?//?8/8?octant
{
e=dy-dx/2;
while(x1<=x2)
{
point.x?=?x1;
????point.y?=?y1;
LcdDrawPoint(&point);
if(e>0){y1-=1;e-=dx;}
x1+=1;
e+=dy;
}
}
else //?7/8?octant
{
e=dx-dy/2;
while(y1>=y2)
{
point.x?=?x1;
????point.y?=?y1;
LcdDrawPoint(&point);
if(e>0){x1+=1;e-=dy;}
y1-=1;
e+=dx;
}
}
}
}
else?//dx<0
{
dx=-dx; //dx=abs(dx)
if(dy?>=?0)?//?dy>=0
{
if(dx>=dy)?//?4/8?octant
{
e=dy-dx/2;
while(x1>=x2)
{
point.x?=?x1;
????point.y?=?y1;
LcdDrawPoint(&point);
if(e>0){y1+=1;e-=dx;}
x1-=1;
e+=dy;
}
}
else //?3/8?octant
{
e=dx-dy/2;
while(y1<=y2)
{
point.x?=?x1;
????point.y?=?y1;
LcdDrawPoint(&point)
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-06-10?11:19??RFID-注冊機\
?????文件???????16486??2016-05-24?11:58??RFID-注冊機\c8051F340.h
?????文件??????????19??2016-05-24?11:58??RFID-注冊機\ExtDll.iex
?????文件???????18251??2016-05-24?11:58??RFID-注冊機\fontlib.h
?????文件???????16234??2016-05-24?11:58??RFID-注冊機\fontlib.h.bak
?????文件????????6763??2016-05-24?11:58??RFID-注冊機\gui.c
?????文件????????6763??2016-05-24?11:58??RFID-注冊機\gui.c.bak
?????文件?????????825??2016-05-24?11:58??RFID-注冊機\gui.h
?????文件????????1051??2016-05-24?11:58??RFID-注冊機\gui.h.bak
?????文件???????17257??2016-05-24?11:58??RFID-注冊機\gui.LST
?????文件???????31120??2016-05-24?11:58??RFID-注冊機\gui.OBJ
?????文件????????1265??2016-05-24?11:58??RFID-注冊機\gui_type.h
?????文件????????1649??2016-05-24?11:58??RFID-注冊機\init.h
?????文件??????171866??2016-05-24?11:58??RFID-注冊機\lcd
?????文件????????7515??2016-05-24?11:58??RFID-注冊機\lcd.c
?????文件????????6353??2016-05-24?11:58??RFID-注冊機\lcd.c.bak
?????文件????????1573??2016-05-24?11:58??RFID-注冊機\lcd.h
?????文件???????15346??2016-05-24?11:58??RFID-注冊機\lcd.LST
?????文件???????22628??2016-05-24?11:58??RFID-注冊機\lcd.OBJ
?????文件????????7741??2016-05-24?11:58??RFID-注冊機\main.c
?????文件????????6978??2016-05-24?11:58??RFID-注冊機\main.c.bak
?????文件???????14396??2016-05-24?11:58??RFID-注冊機\main.LST
?????文件????????3742??2016-05-24?11:58??RFID-注冊機\menu.c
?????文件???????11176??2016-05-24?11:58??RFID-注冊機\menu.c.bak
?????文件???????10402??2016-05-24?11:58??RFID-注冊機\menu.LST
?????文件???????19551??2016-05-24?11:58??RFID-注冊機\menu.OBJ
?????文件????????3900??2016-05-24?11:58??RFID-注冊機\RFIDCOM.c
?????文件????????3900??2016-05-24?11:58??RFID-注冊機\RFIDCOM.c.bak
?????文件????????1838??2016-05-24?11:58??RFID-注冊機\RFIDCOM.h
?????文件????????1842??2016-05-24?11:58??RFID-注冊機\RFIDCOM.h.bak
?????文件???????10002??2016-05-24?11:57??RFID-注冊機\RFIDCOM.LST
............此處省略21個文件信息
評論
共有 條評論