|
使用WIDGET_ProgbarCustomSkin.c,在自定义皮肤函数_CustomSkin中显示位图bmIcon_Cloud_SSL_64x64,在这个图标移动到进度条一半后,图标只显示一半。
第二个问题,设置PROGBAR_SetMinMax(hProg, Min, Max);max=150.为什么还是最大显示100%!好像设置了不管用。
case WIDGET_ITEM_DRAW_BACKGROUND:
//
// Receive the area of the PROGBAR widget
//
WM_GetClientRectEx(pDrawItemInfo->hWin, &Rect);
//
// Adapt the rectangle to be used for rounded rects
//
Rect.x0 += RR_ADD;
Rect.y0 += RR_ADD;
Rect.x1 -= RR_ADD;
Rect.y1 -= RR_ADD;
//
// Draw a green rounded rect over the complete area, this gets (partially) overwritten by a white one
//
GUI_SetColor(GUI_GREEN);
/*GUI_FillRoundedRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1, RADIUS);*/
GUI_DrawBitmap(&bmBACK, Rect.x0, Rect.y0);
////
//// Set a user cliprect
////
//UserRect.x0 = pDrawItemInfo->x0;
//UserRect.y0 = pDrawItemInfo->y0;
//UserRect.x1 = pDrawItemInfo->x1;
//UserRect.y1 = pDrawItemInfo->y1;
//WM_SetUserClipRect(&UserRect);
////
//// Draw a white rounded rect over the whole PROGBAR area, but the drawing will be visible only in
//// the area of the cliprect. The size of the cliprect will decrease over time and the white rect
//// will get smaller.
////
//GUI_SetColor(GUI_WHITE);
//GUI_FillRoundedRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1, RADIUS);
if (((PROGBAR_SKINFLEX_INFO *)pDrawItemInfo->p)->Index == PROGBAR_SKINFLEX_R)
GUI_DrawBitmap(&bmIcon_Cloud_SSL_64x64, pDrawItemInfo->x0, pDrawItemInfo->y0);
//GUI_DrawBitmap(&bmIcon_Cloud_SSL_64x64, pDrawItemInfo->x0, pDrawItemInfo->y0);
////
//// Very important, restore the the clipping area
////
//WM_SetUserClipRect(NULL);
////
//// Almost done, just a draw a red frame over the whole area
////
//GUI_SetColor(GUI_RED);
//GUI_DrawRoundedRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1, RADIUS);
return 0;
|
|