打印
[内核技术]

ucGUI的问题

[复制链接]
1690|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
wangch_sh|  楼主 | 2013-7-21 16:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#include “GUI.H”
static const GUI_POINT aPoints[] =
{
{-50,0},{-10,10},{0,50},{10,10},{50,0},{10,-10},{0,-50},{-10,-10}
};
#define SIZE_OF_ARRAY (Array)(sizeof(Array)/sizeof(Array[0]))
typedef struct
{
int XPos_Poly, YPos_Poly; int XPos_Text, YPos_Text; GUI_POINT aPointsDest[8];
} tDrawItContext;
/***************************************************************************
*  绘图函数   *
***************************************************************************/
static void DrawIt(void * pData)
{
tDrawItContext * pDrawItContext = (tDrawItContext *)pData;
GUI_Clear();
GUI_SetFont(&GUI_Font8x8);
第11页  µC/GUI中文手册
第10章 存储设备
GUI_SetTextMode(GUI_TM_TRANS);
/* 绘背景 */
GUI_SetColor(GUI_GREEN);
GUI_FillRect (  pDrawItContext->XPos_Text,
pDrawItContext->YPos_Text - 25,
pDrawItContext->XPos_Text + 100,
pDrawItContext->YPos_Text - 5);
/* 绘多边形 * /
GUI_SetColor(GUI_BLUE);
GUI_FillPolygon (pDrawItContext->aPointsDest,
SIZE_OF_ARRAY(aPoints),
160, 120);
/* 绘前景 * /
GUI_SetColor(GUI_RED);
GUI_FillRect(  220 - pDrawItContext->XPos_Text,
pDrawItContext->YPos_Text + 5,
220 - pDrawItContext->XPos_Text + 100,
pDrawItContext -> YPos_Text + 25);
}
/***************************************************************************
*  展示分片存储设备   *
***************************************************************************/
#define USE_BANDING_MEMDEV (1)
/* 如设为 0,则定义不使用分片存储设备进行绘图 */
void DemoBandingMemdev(void)
{
int i;
int XSize = LCD_GET_XSIZE();
int YSize = LCD_GET_YSIZE();
tDrawItContext DrawItContext;
GUI_SetFont(&GUI_Font8x9);
GUI_SetColor(GUI_WHITE);
GUI_DispStringHCenterAt (  “Banding memory device\nwithout flickering”,
XSize/40)
DrawItContext.XPos_Poly = Xsize/2;
DrawItContext.YPos_Poly = Ysize/2;
第12页  µC/GUI中文手册
第10章 存储设备
DrawItContext.YPos_Text = Ysize/2-4;
for(i = 0; i < (XSize - 100); i++)  
  float angle = i * 3.1415926 / 60;
DrawItContext.XPos_Text = i;
/* 旋转多边形 * /
GUI_RotatePolygon ( DrawItContext.aPointsDest,
aPoints,
SIZE_OF_ARRAY(aPoints),
angle);
#if USE_BANDING_MEMDEV
{
GUI_RECT Rect = { 0, 70, 320, 170} ;
/* 使用分片存储设备进行绘图 */
GUI_MEMDEV_Draw(&Rect, &DrawIt, &DrawItContext, 0, 0);
}
#else
/* 不使用存储设备的简单绘图 */
DrawIt((void *)&DrawItContext);
#endif
#ifdef WIN32
GUI_Delay(20); /* 只有在仿真时才使用一段短延时 */
#endif
}
/***************************************************************************
*  主函数   *
***************************************************************************/
void main (void)
{
GUI_Init () ;
while(1)
{
DemoBandingMemdev();
}
}
SIZE_OF_ARRAY(aPoints)这一句有错误,怎么改呀?
这是UCGUI手册上的例子。
请高手指教,谢谢!

相关帖子

沙发
610095871| | 2013-7-22 11:29 | 只看该作者
memdev_banding.rar (1.23 KB)
这是那个例子的源码 你对照下看看那里有问题吧
UCGUI源码学习中---Q群295214484

使用特权

评论回复
板凳
wangch_sh|  楼主 | 2013-7-22 15:06 | 只看该作者
谢谢!

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:为江山踏坏了乌骓马,为社稷拉断了宝雕弓。

318

主题

2814

帖子

5

粉丝