|
楼主 |
发表于 2013-6-5 11:05:22
|
显示全部楼层
回 eric2013 的帖子
eric2013:    uint32_t   ulStartTime,  ulEendTime;
    ulStartTime = GUI_GetTime();
    while(1)
    {           & .. (2013-06-05 10:50)  手册上就给句柄就好了,我现在是想在一个对话框中画图,而且需要实时改变图片的位置,本来在建立对话框之后直接用GUI_DrawBitmap(&bmpicture0, x, y);发现不行这个函数只有在WM_Paint消息下使用才能显示图片,所以想每次都给对话框发重绘消息 。好像用了WM_PAINT也不行啊。
WM_HWIN Pmbh_hwin;
// WM_MESSAGE MyMessage;
TEXT_Handle TextHand;
// uint16_t x=0,y=0;
Pmbh_hwin=GUI_CreateDialogBox(_SetScreen1, GUI_COUNTOF(_SetScreen1), &_cbSetScreen1, 0, 0, 0);
// pMUhwin = WM_GetClientWindow(Pmbh_hwin);
// TextHand = TEXT_CreateEx(322,216,53, 12,Pmbh_hwin,WM_CF_SHOW,TEXT_CF_HCENTER,GUI_ID_TEXT0,"SDFJG");
// TEXT_SetBkColor(TextHand,0xffffff);
while(1)
{
srand(Get_Time_type.SEC);
WM_Exec();
x=rand()%700;//
y=rand()%400;//
WM_Paint(Pmbh_hwin);
// MyMessage.MsgId=WM_PAINT;
// WM_SendMessage(Pmbh_hwin, &MyMessage);
// WM_InvalidateWindow(Pmbh_hwin);
// WM_MoveTo(TextHand,x,y);
// GUI_DrawBitmap(&bmpicture0, x, y);
if(!PMBH_Flag)
{
TEXT_Delete(TextHand);
GUI_EndDialog(Pmbh_hwin, 0);
break;
}
GUI_Delay(200);
}
}
回调函数
static void _cbSetScreen1(WM_MESSAGE * pMsg)
{
// int NCode, Id;
// WM_HWIN hWin = pMsg->hWin;
switch (pMsg->MsgId)
{
case WM_PAINT:
GUI_DrawBitmap(&bmpicture0, x, y);
break; |
|