void RTCDrawnMenu(int XCenter,int YCenter,int Radius)
{
BUTTON_Handle ModifyIDHandle,EnterIDHandle,ReturnIDHandle;
PARAM Param;
GUI_AUTODEV AutoDev;
GUI_SetBkColor(GUI_Silver);
GUI_Clear();
GUI_AA_DisableHiRes();
GUI_AA_SetFactor(5);
while(1)
{
GUI_MEMDEV_CreateAuto(&AutoDev);
ColckTemp=RTC_GetCounter(); //RTC程序用原子的
RTC_Get(ColckTemp);
Param.xhour=(calendar.hour*30)*3.1415926f/180;
GUI_RotatePolygon(Param.aPoints, _aNeedle, countof(_aNeedle),Param.xhour);
Param.xmin =(calendar.min*6)*3.1415926f/180;
GUI_RotatePolygon(Param.aPoints1, _aNeedle1, countof(_aNeedle1),Param.xmin );
Param.xsec =(calendar.sec*6)*3.1415926f/180;
GUI_RotatePolygon(Param.aPoints2, _aNeedle2, countof(_aNeedle2),Param.xsec);
GUI_MEMDEV_DrawAuto(&AutoDev, &
aram.AutoDevInfo, &_Draw, &
aram);
ModifyIDHandle=BUTTON_Create(15,270,70,50,ModifyID, WM_CF_SHOW );
EnterIDHandle=BUTTON_Create(85,270,70,50,EnterID,WM_CF_SHOW);
ReturnIDHandle=BUTTON_Create(155,270,70,50,ReturnID,WM_CF_SHOW);
BUTTON_SetBkColor(ModifyIDHandle,BUTTON_CI_UNPRESSED,GUI_RED);
BUTTON_SetBkColor(EnterIDHandle,BUTTON_CI_UNPRESSED,GUI_RED);
BUTTON_SetBkColor(ReturnIDHandle,BUTTON_CI_UNPRESSED,GUI_RED);
GUI_Delay(300);
LED1( OFF);
}
}
void _Draw(void * p) {
int i,x,y;
float a;
char ac[4];
float ahour,amin,asec;
int XCenter=120;int YCenter=110;int Radius=100;
PARAM * pParam;
pParam = (PARAM *)p;
if (pParam->AutoDevInfo.DrawFixed)
{
GUI_SetBkColor(GUI_Silver);
GUI_Clear();
GUI_SetPenSize( 5 );
GUI_SetTextMode(GUI_TM_TRANS);
GUI_SetFont(&GUI_FontComic18B_ASCII);
GUI_SetColor(GUI_BLACK);
GUI_AA_DrawArc( XCenter,YCenter,Radius,Radius,-90, 360 );
for (i=0; i<= 11; i++) {
a = (90+i*30)*3.1415926/180;
x = -90*cos(a)+XCenter;
y = -90*sin(a)+YCenter;
if (i%3 == 0)
GUI_SetPenSize( 5 );
else
GUI_SetPenSize( 4 );
GUI_DrawPoint(x,y);
if (i%3 == 0) {
x = -72*cos(a)+XCenter;
y = -80*sin(a)+YCenter;
if(i==0){sprintf(ac, "%d", 12);}
else{sprintf(ac, "%d", i);}
GUI_SetTextAlign(GUI_TA_VCENTER);
GUI_DispStringHCenterAt(ac,x,y);
}
}
}
GUI_SetColor(GUI_BLACK);
GUI_AA_FillPolygon(pParam->aPoints, countof(_aNeedle),120,110);
GUI_SetColor(GUI_BLACK);
GUI_AA_FillPolygon(pParam->aPoints1, countof(_aNeedle1),120,110);
GUI_SetColor(GUI_RED);
GUI_AA_FillPolygon(pParam->aPoints2, countof(_aNeedle2),120,110);
if (pParam->AutoDevInfo.DrawFixed)
{
}
}
求大神指点指点