怎么将FB 中的内容,按屏幕旋转的方向进行显示. ( 0度 90度 180度 270 度进行显示), 请给一个思路. [有关问题点数
如何将FB 中的内容,按屏幕旋转的方向进行显示. ( 0度 90度 180度 270 度进行显示), 请给一个思路. [问题点数
一个小系统上的 int GUI_BitString_8bppDrawEx(FB* fb,int x0, int y0)
函数可将 FB 中的字符 正确显示到 LCD 屏幕上(即 0度),
现在需要将显示的内容旋转90度 或 180度, GUI_BitString_8bppDrawEx函数应要修改,请提示一下. 谢谢
int GUI_BitString_8bppDrawEx(FB* fb,int x0, int y0)
{
int Ret = 0;
int Height = fb->size.height;
int Width = fb->size.width;
int y, BytesPerLine , tmp_y;
int LCDXSize = 0;
int LCDYSize = 0;
U8 *pDest = NULL;
const U8 * pSrc = (const U8 *)fb->addr[0];
GUI_LOCK();
if((Screen_Context.LCDDirection[GUI_Context.SelLayer] == GUI_SCNDIR_ROTATE90)
||(Screen_Context.LCDDirection[GUI_Context.SelLayer] == GUI_SCNDIR_ROTATE270))
{
LCDXSize = Screen_Context.LCDYSize[GUI_Context.SelLayer];
LCDYSize = Screen_Context.LCDXSize[GUI_Context.SelLayer];
}
else
{
LCDXSize = Screen_Context.LCDXSize[GUI_Context.SelLayer];
LCDYSize = Screen_Context.LCDYSize[GUI_Context.SelLayer];
}
if(x0 >= LCDXSize)
{
GUI_UNLOCK();
return EPDK_FAIL;
}
tmp_y = y0 + Height;
if(tmp_y > LCDYSize)
{
Height = LCDYSize - y0;
}
pDest = (unsigned char *)(orange.fbaddr[GUI_Context.SelLayer]) + (y0 *LCDXSize) + (x0);
BytesPerLine = Width;
for (y=0; y < Height; y++)
{
memcpy(pDest, pSrc, Width);
pSrc += BytesPerLine;
pDest = (U8*)(pDest +LCDXSize);
}
GUI_UNLOCK();
return Ret;
}
------解决方案--------------------
FB是什么?
一个小系统上的 int GUI_BitString_8bppDrawEx(FB* fb,int x0, int y0)
函数可将 FB 中的字符 正确显示到 LCD 屏幕上(即 0度),
现在需要将显示的内容旋转90度 或 180度, GUI_BitString_8bppDrawEx函数应要修改,请提示一下. 谢谢
int GUI_BitString_8bppDrawEx(FB* fb,int x0, int y0)
{
int Ret = 0;
int Height = fb->size.height;
int Width = fb->size.width;
int y, BytesPerLine , tmp_y;
int LCDXSize = 0;
int LCDYSize = 0;
U8 *pDest = NULL;
const U8 * pSrc = (const U8 *)fb->addr[0];
GUI_LOCK();
if((Screen_Context.LCDDirection[GUI_Context.SelLayer] == GUI_SCNDIR_ROTATE90)
||(Screen_Context.LCDDirection[GUI_Context.SelLayer] == GUI_SCNDIR_ROTATE270))
{
LCDXSize = Screen_Context.LCDYSize[GUI_Context.SelLayer];
LCDYSize = Screen_Context.LCDXSize[GUI_Context.SelLayer];
}
else
{
LCDXSize = Screen_Context.LCDXSize[GUI_Context.SelLayer];
LCDYSize = Screen_Context.LCDYSize[GUI_Context.SelLayer];
}
if(x0 >= LCDXSize)
{
GUI_UNLOCK();
return EPDK_FAIL;
}
tmp_y = y0 + Height;
if(tmp_y > LCDYSize)
{
Height = LCDYSize - y0;
}
pDest = (unsigned char *)(orange.fbaddr[GUI_Context.SelLayer]) + (y0 *LCDXSize) + (x0);
BytesPerLine = Width;
for (y=0; y < Height; y++)
{
memcpy(pDest, pSrc, Width);
pSrc += BytesPerLine;
pDest = (U8*)(pDest +LCDXSize);
}
GUI_UNLOCK();
return Ret;
}
------解决方案--------------------
FB是什么?