單片機(jī)C語(yǔ)言實(shí)例-204-彩屏控制
/*
================================================================================
File Name : GUI_Basic.c
Author : LiYOng
Date : 2008-12-12 15:51
Version : 1.0
Decription: This file contains some basic functions for GUI, It need the LCD
Drive functions
================================================================================
*/
#include "GUI_Basic.H"
#include "GUI_Type.H"
#include "fontlib.h"
/*
================================================================================
Function : GUI_DrawRectangle( )
Description : Draw a rectangle
Input : -pRect, point to a rectangle structure
output : None
================================================================================
*/
void GUI_DrawRectangle( RECT* pRect )
{
LINE line;
line.xs = pRect->xs;
line.xe = pRect->xe;
line.ys = pRect->ys;
line.ye = pRect->ys;
line.Color = pRect->Color;
LCDDrawHRLine( &line );
line.xe = pRect->xs;
line.ye = pRect->ye;
LCDDrawHRLine( &line );
line.xs = pRect->xe;
line.ys = pRect->ye;
LCDDrawHRLine( &line );
line.xe = pRect->xe;
line.ye = pRect->ys;
LCDDrawHRLine( &line );
}
/*
================================================================================
Function : GUI_DrawLine( )
Description : Draw a line
Input : -pLine, point to a line structure
output : None
================================================================================
*/
void GUI_DrawLine( LINE* pLine )
{
INT32S dx; // 直線x軸差值變量
INT32S dy; // 直線y軸差值變量
INT32S dx_sym; // x軸增長(zhǎng)方向,為-1時(shí)減值方向,為1時(shí)增值方向
INT32S dy_sym; // y軸增長(zhǎng)方向,為-1時(shí)減值方向,為1時(shí)增值方向
INT32S dx_x2; // dx*2值變量,用于加快運(yùn)算速度
INT32S dy_x2; // dy*2值變量,用于加快運(yùn)算速度
INT32S di; // 決策變量
POINT point;
LINE line;
line.xs = pLine->xs;
line.ys = pLine->ys;
line.xe = pLine->xe;
line.ye = pLine->ye;
line.Color = pLine->Color;
point.Color = pLine->Color;
dx = line.xe - line.xs;
dy = line.ye - line.ys;
更多詳情參考附件文檔
+08:00C420聯(lián)盟網(wǎng)7718.png (60.36 KB, 下載次數(shù): 4)
下載附件
保存到相冊(cè)
2022-2-22 17:05 上傳
游客,如果您要查看本帖隱藏內(nèi)容請(qǐng) 回復(fù)
|