Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Mon, 4 Aug 2008 10:08:46 -0400,    group: microsoft.public.win32.programmer.ui        back       


Toolbar Image Background   
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
date: Mon, 4 Aug 2008 10:08:46 -0400   author:   David Golub

Re: Toolbar Image Background   
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 07:32:38 -0700 (PDT)   author:   Kellie Fitton

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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us