I’ve got a wxWidgets program. For one piece of it, I want to use an alpha channel to “fade” a set of icons if the system supports alpha-blending, and grayscale them if it doesn’t, but I can’t seem to find any way to tell whether the system supports alpha-blending or not.
Is there something I’m missing, or is there no wxWidgets and/or cross-platform way to do this?
(I’m fairly well conversant with wxWidgets, but I’ve never done alpha-blending before.)
From what I can tell, you call
CanSetTransparenton a top-level window, and if it returnstrue, callSetTransparentwith a value < 255. If that returnstrue, then the system supports alpha transparency. You must do this after the top-level window you’re working with is shown.(
CanSetTransparentjust checks the OS version under Windows, always returnstrueunder Mac OS, and checks both the compile-time GTK version and a function on wxGTK.SetTransparenttakes different paths on Windows and GTK depending on whether the value is 255 or something less.)