Button corners are not antialiased.

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

  • Button corners are not antialiased.

    Hi ,

    When i am using the button widget, the borders at the corner are not anti-aliased. In order to make it anti-aliased i have handled WM_PAINT message and used GUI_AA_DrawRoundedRect() method to draw the button corners.
    But once this is done, i don't see the button pressed effect any more. I don't know how this is to be handled.

    In short i need a button with anti-aliased corners, and at the same time i need to preserve the button press effect too.
    Any help would be greatly appreciated. If you guys can provide a sample, that will be great.

    Thanks,
    NKechi
  • Hi NKechi,

    When overwriting the callback you have to react on the different states of a button, too.
    This can be done by calling BUTTON_IsPressed(pMsg->hWin). It returns 1 if the button is pressed and 0 if not.

    Another way might be to use a custom skinning routine and react on the proper commands to distinguish between the state and which part of the buttons gets drawn.

    Please take a look into the emWin user manual (UM03001_emWin5.pdf) at chapter 22 'Skinning' for more information about skinning.

    In regards of performance I would recommend to use two different bitmaps with transparency (used for soft edges) instead of using AA routines.

    Regards,
    Sven
    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.