ucgui 储存设备分析
- 优势
使用储存设备,会开辟一段内存,一系列绘图操作保存这段内存中,仅在调用GUI_MEMDEV_CopyToLCD() 时 更新。
- 相关函数 及步骤
- 创建储存设备 GUI_MEMDEV_Create()
- 激活它 GUI_MEMDEV_Select()
- 执行绘制操作
- 将结果赋值到LCD 上.( GUI_MEMDEV_CopyToLCD() ,在重绘 回调函数中使用GUI_MEMDEV_Write()函数)
- 不使用时,删除该储存设备(GUI_MEMDEV_Delete())
过程分析
先列出上下 文 结构体
typedef struct {
/* Variables in LCD module */
LCD_COLORINDEX_UNION LCD;
LCD_RECT ClipRect; //矩形
U8 DrawMode;//绘制模式
U8 SelLayer; //层
U8 TextStyle;//文本样式
/* Variables in GL module */
GUI_RECT* pClipRect_HL; /* High level clip rectangle ... Speed optimization so drawing routines can optimize */
U8 PenSize;
U8 PenShape;
U8 LineStyle;
U8 FillStyle;
/* Variables in GUICHAR module */
const GUI_FONT GUI_UNI_PTR * pAFont;
const GUI_UC_ENC_APILIST * pUC_API; /* Unicode encoding API */
I16P LBorder;
I16P DispPosX, DispPosY;
I16P DrawPosX, DrawPosY;
I16P TextMode, TextAlign;
GUI_COLOR Color, BkColor; /* Required only when changing devices and for speed opt (caching) */
/* Variables in WM module */
#if GUI_WINSUPPORT
const GUI_RECT* WM__pUserClipRect;
GUI_HWIN hAWin;
int xOff, yOff;
#endif
/* Variables in MEMDEV module (with memory devices only) */
#if GUI_SUPPORT_DEVICES //储存设备相关
const tLCDDEV_APIList* pDeviceAPI; /* function pointers only */
GUI_HMEM hDevData;
GUI_RECT ClipRectPrev;