EmWin Transparent Button with Bitmap Image ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EmWin Transparent Button with Bitmap Image ?

2,665 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tonko on Fri Dec 13 02:37:22 MST 2013
  Hi !

I'm trying to use bitmap image on Button widget. Only bitmap image on button should be visible, button should be transparent.
Part of bmp image is transparent and I want to see background window around button image where image is transparent.
What is wrong now is that button is visible in background, It should be transparent or invisible.

Source files in attachment

Original Attachment has been moved to: Button_AdvancedSettings64x64.c.zip

Original Attachment has been moved to: WindowDLG.c.zip

Labels (1)
0 Kudos
2 Replies

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Cusko on Fri Dec 20 04:57:14 MST 2013
Look at the attachment. Try if it works for you.
0 Kudos

1,244 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ildar on Fri Dec 13 04:16:06 MST 2013
Hello!

We solved same problem with method:
  
    
#define GUI_INVALID_COLOR0xFFFFFFF      /* Invalid color - more than 24 bits */

...
GUI_Init();
BUTTON_SetDefaultSkin(Custom_BUTTON_DrawSkinFlex);
...

static int Custom_BUTTON_DrawSkinFlex(const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo)
{
switch (pDrawItemInfo->Cmd)
{
case WIDGET_ITEM_DRAW_BACKGROUND:
{
GUI_COLOR background = BUTTON_GetBkColor(pDrawItemInfo->hWin, BUTTON_CI_UNPRESSED);
if (background != GUI_INVALID_COLOR)
{
return BUTTON_DrawSkinFlex(pDrawItemInfo);
}
break;
}
default:
return BUTTON_DrawSkinFlex(pDrawItemInfo);
}
return 0;
}


With regards, Gilmanov Ildar
0 Kudos