There is a feature in my MZ-Tools add-in that requires to show the pictures of its commands in a treeview, to select which ones to be visible or not. When using Visual Studio 2012 and the Dark theme, the background of the form and the treeview are darked, and the bitmaps should have inverted colors.
I wanted to reuse the command pictures and use a function that inverts their colors as VS 2012 does. I knew the ThemeDIBits method of the IVsUIShell5 interface, but it took me a while to discover a Visual Studio assembly that used it. Finally I found it and here is the approach:
HOWTO: Get an inverted bitmap to use with the Dark theme of Visual Studio 2012 from an add-in.
http://www.mztools.com/articles/2012/MZ2012030.aspx
The sample also shows how to get the background color of toolwindows, using also the IVSUIShell5 interface.
Note: my command pictures use the almost green (RGB=0,254,0) to denote the transparent color, and the sample provided uses that color, but you can use any color.