Antialiasing with WM

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Antialiasing with WM

    Hi,

    Could you tell me how I can use for example

    C Source Code

    1. GUI_SetColor(GUI_GREEN); GUI_SetPenSize(5); GUI_AA_DrawRoundedRect(10, 10, 50, 50, 5);



    in a callback function static void _cbDialog(WM_MESSAGE * pMsg).

    I try draw GUI_AA_DrawRoundedRect() without WM - result success. But with Window Manager I can't reach success result. Is there a way using 2D graphics or antialiasing functions with WM?


    And why when I using this I have no draw rectangle
    case WM_USER:
    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
    TEXT_SetTextColor(hItem, GUI_WHITE);
    TEXT_SetText(hItem, pMsg->Data.p);
    TEXT_SetFont(hItem, &GUI_FontArialNarrow16);

    GUI_SetColor(GUI_GREEN);
    GUI_SetPenSize(5);
    GUI_AA_DrawRoundedRect(10, 10, 50, 50, 5); break;



    But If I using in next way I see success draw rectangle(why it's happen, what differences)?
    case WM_USER:
    hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
    TEXT_SetTextColor(hItem, GUI_WHITE); TEXT_SetText(hItem, pMsg->Data.p);
    TEXT_SetFont(hItem, &GUI_FontArialNarrow16);
    break;
    case WM_PAINT:
    GUI_SetColor(GUI_GREEN);
    GUI_SetPenSize(5);
    GUI_AA_DrawRoundedRect(10, 10, 50, 50, 5);
    break;

    The post was edited 4 times, last by krufter ().

  • Hi,

    we recommend that drawing operations should be done only within the WM_PAINT event as explained in the documentation. If drawing is done outside a WM_SelectWindow() is required.

    Regards, Jörg
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.