i use DrawBitmap to draw some bitmaps (each with a wxMask) on a black background. is there any way to draw some of them darker, as if they had a 50% transparency? i do not want to repaint those with darker colors.
my goal is to highlight one of these bitmaps visually.
draw bitmap darker as if it had 50% transparency Topic is solved
Re: draw bitmap darker as if it had 50% transparency
If you're using wxGraphicsContext for drawing, wxGraphicsContext::BeginLayer() should work.
https://docs.wxwidgets.org/trunk/classw ... caa097ca1f
Under Windows, only the D2D renderer supports it, not the default GDI+ renderer.
Or you could use something like wxImage::ChangeBrightness() to change the bitmap data itself.
https://docs.wxwidgets.org/trunk/classw ... 0ebd2f666a
https://docs.wxwidgets.org/trunk/classw ... caa097ca1f
Under Windows, only the D2D renderer supports it, not the default GDI+ renderer.
Or you could use something like wxImage::ChangeBrightness() to change the bitmap data itself.
https://docs.wxwidgets.org/trunk/classw ... 0ebd2f666a
Use the source, Luke!
-
- Ultimate wxWidgets Guru
- Posts: 539
- Joined: Fri May 22, 2009 8:52 am
- Location: Bremen, Germany
Re: draw bitmap darker as if it had 50% transparency
okay, thank you, then just painting with darker colors is the easier option for me.
-
- Ultimate wxWidgets Guru
- Posts: 539
- Joined: Fri May 22, 2009 8:52 am
- Location: Bremen, Germany
Re: draw bitmap darker as if it had 50% transparency
just in case someone has the same problem: wxBitmap::ConvertToDisabled(126) does the trick https://docs.wxwidgets.org/3.1.2/classw ... 54349bc22d