I tried several ways to draw a disabled toolbar button bitmap.
I build a "ownerdraw" toolbar, and use a CreateMappedBitmap
for drawing the buttons. All works fine, but the disabled state of the buttons.

I tried "DrawState" but this looks not ok, and some other stuff, which I found on the Internet, but no results...

I hope you can help me further ...
Posted on 2002-06-18 03:30:07 by beaster
http://www.codeguru.com/bitmap/dither_blt.shtml


[...]
I have tried the DrawState function before writing one of my own. However, what I have got disappointed me because I found that often, some colors are badly converted from the original image and disapear into the result.
[...]


Sounds like he had the same problem as you. The source is easy to understand :)

P.S.: Example picture: http://www.codeguru.com/bitmap/dither_blt.jpg
Posted on 2002-06-18 03:43:59 by bazik
thanks, I found this article too, but I didnt try it, because some replies state that it does not work. I think I will try it anyway...
Posted on 2002-06-18 04:09:16 by beaster
It seems that DrawState's documentation is a bit weird. Maybe you can read this article from an old issue of MSJ.
Posted on 2002-06-18 12:27:54 by LuHa
thanks! thats the way it works...

1. load bitmap with CreateMappedBitmap (maps gray pixels to the COLOR_BTNFACE color of windows)
2. create an ImageList from it (ImageList_Draw flags are not proper for this task)
3. extract an icon from the ImageList
4. use DrawState with the icon (because dont work with bitmaps)
5. free icon

I wonder why I didn't found this easy way on myself :)
Posted on 2002-06-19 03:56:20 by beaster