|
|
|
date: Mon, 4 Aug 2008 10:08:46 -0400,
group: microsoft.public.win32.programmer.ui
back
Re: Toolbar Image Background
The problem that I'm having doesn't seem to be related to color depth. It's
that the button background is showing up in the gray RGB( 192, 192, 192 )
instead of being mapped to the appropriate system color to match the color
of the toolbar. If I use an image list with ImageList_AddMasked instead of
TB_ADDBITMAP, it changes the gray mask color to black, which is definitely
not what I want.
David Golub
"Kellie Fitton" wrote in message
news:e8784126-ae3d-4910-a408-d8af89277cf8@z72g2000hsb.googlegroups.com...
On Aug 4, 7:08 am, "David Golub" wrote:
> I've been writing some code to create a toolbar with comctl32.dll. I
> create
> it with CreateWindow and then send TB_BUTTONSTRUCTSIZE and
> TB_SETBITMAPSIZE.
> I then send TB_ADDBITMAP and TB_ADDBUTTONS to add each button. When the
> toolbar displays, it shows the background of each button image as RGB(
> 192,
> 192, 192 ) instead of mapping that color to the appropriate system color.
> Does anyone know what might be causing this problem? Thank you.
>
> David Golub
Hi,
The image list that toolbar internally creates is limited to 16
colors.
you can work around this by creating your own image list with the
desired color depth. You can use the following APIs/toolbar messages
to create the image list for the toolbar control:
ImageList_Create()
ImageList_AddMasked()
TB_SETIMAGELIST
TB_SETDISABLEDIMAGELIST
TB_SETHOTIMAGELIST
TB_SETBITMAPSIZE
TB_ADDBITMAP
http://msdn2.microsoft.com/en-us/library/ms671757.aspx
http://msdn2.microsoft.com/en-us/library/ms671754.aspx
http://msdn2.microsoft.com/en-us/library/ms650894.aspx
http://msdn2.microsoft.com/en-us/library/ms650889.aspx
http://msdn2.microsoft.com/en-us/library/ms650892.aspx
http://msdn2.microsoft.com/en-us/library/ms650882.aspx
http://msdn2.microsoft.com/en-us/library/ms650699.aspx
Kellie.
date: Mon, 4 Aug 2008 10:53:28 -0400
author: David Golub
|
|