[C] 纯文本查看 复制代码 static void _FillRect(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) {
LCD_PIXELINDEX ColorIndex;
int x;
if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR)
{
for (; y0 <= y1; y0++)
{
for (x = x0; x <= x1; x++)
{
_XorPixel(pDevice, x, y0);
}
}
}
else
{
/* 选择进行优化 */
#if emWin_Optimize
ColorIndex = LCD__GetColorIndex();
if (g_ChipID == IC_8875)
{
RA8875_RTERect( x0, y0, x1, y1, ColorIndex);
}
else
{
ILI9488_FillRect(x0, y0, y1-y0+1, x1-x0+1, ColorIndex);
}
#else
for (; y0 <= y1; y0++)
{
_DrawHLine(pDevice, x0, y0, x1);
}
#endif
}
}
/*
*********************************************************************************************************
* 函 数 名: GUI_FillRect
* 功能说明: 用于emWin的接口函数
* 形 参: _bright 亮度,0是灭,255是最亮
* 返 回 值: 无
*********************************************************************************************************
*/
void RA8875_RTERect(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t _usColor)
{
s_ucRA8875Busy = 1;
BTE_SetTarBlock(x0, y0, y1-y0+1, x1-x0+1, 0); /* 设置BTE位置和宽度高度 */
BTE_SetOperateCode(0x0C); /* 设定BTE 操作码和光栅运算码 REG[51h] Bit[3:0] = 0Ch */
RA8875_SetFrontColor(_usColor); /* 设置BTE前景色 */
BTE_Start(); /* 开启BTE 功能 */
BTE_Wait();
s_ucRA8875Busy = 0;
}
我用的也是emWin里面这个接口!!! |