Antialiasing with WM

  • Hi,

    Could you tell me how I can use for example

    C
    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;

    Edited 4 times, last by krufter (February 3, 2016 at 2:09 PM).

  • 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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!