Button background

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

    • Button background

      Hello,

      Am using a Button widget and default skin is drawn for button widget. I have drawn a transparent bmp on the button widget but I see the button background and border of the button which i do not want. How to get rid of the background so that only the bmp area is visible. code below. The bmp is saved in high color with alpha (565) format using bitmap converter.

      Button_Handle1 = BUTTON_CreateEx(215, 130, 44, 44, WM_HBKWIN, WM_CF_SHOW | WM_CF_HASTRANS, 0x0, GUI_ID_BUTTON0);
      BUTTON_SetBitmapEx(Button_Handle1, BUTTON_BI_PRESSED,&bmincreaseButton_objOnly , 0, 0);

      Regards,

      Anuj
    • Hi,

      I think the easiest way is to override the callback function of the button. In the new callback function you can react just on WM_PAINT and leave the other functionality untouched. This callback can also be used for multiple buttons so you don't have to set a dedicated one for each button.

      Take a look into the example attached.

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

      yes, you can set a custom skinning routine.

      Attached is the example from my previous post but with an additional button. For this button I use a custom skinning routine which draws the bitmap. If clicked the button gets also a red background.

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