15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Is CToolBarCtrl button color Settable?

David Budworth -- david@metra.com
Monday, October 28, 1996

Environment: WinNT 4.0 SP1, MS VC++ 4.2b

I have a CToolBarCtrl in a dialog box, and since it seems impossible to
actually create a bitmap with a transperant background in MSDEV, I have
hard set my button icons to a certain color.  I would also like the button
to be the same color so you do not see a black background bitmap on a grey
button.

Does anyone know how to set the color of a Toolbar button?

BTW: I actually need a 20 or so pixel border around the edge of the bitmap,
so I can't just make the buttons the size of the bitmap to make the border
not visible.
Thank you,
-David
david@metra.com
		



Paul Cook -- pxc@kid01pml.icl.co.uk
Wednesday, October 30, 1996

> I have a CToolBarCtrl in a dialog box, and since it seems impossible to
> actually create a bitmap with a transperant background in MSDEV, I have
> hard set my button icons to a certain color.  I would also like the button
> to be the same color so you do not see a black background bitmap on a grey
> button.

Have a look behind the MFC code for toolbars.  AfxLoadSysColorBitmap in 
bartool.cpp fiddles with the bitmap colour table to match the system colours, 
and gives the impression of transparent bitmaps.  It looks like it does 
something very similar to the ::CreateMappedBitmap api.

HTH
Paul.
---
      o o o o o o . . .   ________________________ _________________________
    o      _____          ||Paul Cook            | ||pxc@kid01pml.icl.co.uk|
  .][__n_n_|DD[  ====___  ||Process Solutions    | ||+44 (0)1782 794742    |
 >(________|__|_[_______]_||ICL__________________|_||______________________|_
 _/oo OOOOO oo`  oo  oo   'o^o                o^o` 'o^o                 o^o`
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-




| Вернуться в корень Архива |