hi to all.
i am adding to my toolbar the buttons with TB_ADDBITMAP and TB_ADDBUTTONS.
how can i specify which color of the bitmap is to be considered transparent?

Posted on 2004-09-20 10:28:22 by blues4u
I am not sure if this is valid for a toolbar, but one of the ways to make some bitmap color transparent to parent window is simply replacing it with parent`s window color.


invoke CreateCompatibleDC, 0
mov hdc, eax

invoke SelectObject, hdc, bmp_handle

invoke GetSysColorBrush, COLOR_BTNFACE
mov brush, eax

invoke SelectObject, hdc, brush

invoke GetPixel, hdc, 1, 1
invoke ExtFloodFill, hdc, 1, 1, eax, FLOODFILLSURFACE

invoke DeleteObject, brush

invoke SelectObject, hdc, bmp_handle

; display the bitmap

invoke DeleteDC, hdc
Posted on 2004-09-20 18:07:04 by arafel
I've a little old sample using an imagelist toolbar and treeview, perhaps it could be helpfull..
Posted on 2004-09-22 08:07:57 by ensein
When you load an image with LoadImage and MAP3DCOLORS (or somethig similar) the transparent color is the color of the first pixel in the upper left corner. Maybe it is the same for toolbar
Posted on 2004-09-22 08:52:49 by greenant
hi and thanks to all,
the example with the imagelist toolbar works perfectly :)

Posted on 2004-09-22 10:29:50 by blues4u