Hello, I have a small issue managing a transparent bitmap.
Basically I have a bitmap with transparency with a white logo and I use it on a black background (default "dark" mode).
(This logo has to be also touchable so it is created as a button with its own callback, the parent of the button is the background.)
If I switch to the "light mode" the background will be white and I want the logo to be black preserving its transparency.
I've tried something like this in the WM_PAINT case of the button callback:
Display All
And this inverts the colors of the bitmap but does not preserves transparency as the result is a black logo with a black background.
I suppose it is like that because the button's parent is the background which is white.
I've tried to set to white the background again after the GUI_InvertRect call but it gives no effect.
Any suggestion on how to make it work?
Thank you,
Mark
Basically I have a bitmap with transparency with a white logo and I use it on a black background (default "dark" mode).
(This logo has to be also touchable so it is created as a button with its own callback, the parent of the button is the background.)
If I switch to the "light mode" the background will be white and I want the logo to be black preserving its transparency.
I've tried something like this in the WM_PAINT case of the button callback:
Source Code
- static void _OnPaintLogo(BUTTON_Handle hObj)
- {
- GUI_RECT *pRect;
- GUI_DrawBitmap(g_sGUIStartup.Buttons[BTN_CUSTOMERLOGO_IDX].pCurrImage, 0, 0);
- if (g_App.Settings.GuiColorMode == GUI_TYPE_COLOR_MODE_LIGHT)
- {
- WM_SetHasTrans(hObj);
- WM_GetClientRectEx(hObj, pRect);
- GUI_InvertRect(pRect->x0, pRect->y0, pRect->x1, pRect->y1);
- }
- }
I suppose it is like that because the button's parent is the background which is white.
I've tried to set to white the background again after the GUI_InvertRect call but it gives no effect.
Any suggestion on how to make it work?
Thank you,
Mark