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

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


CToolBarCtrl Bitmaps

Wayne G. Maas -- wgmaas@usa.nai.net
Thursday, October 24, 1996

Environment: VC++ 4.2/Win95

I've got a question I have not been able to find an answer for.

I have an application that creates several CToolbarCtrl toolbars. 
Each button has an Windows application associated with it.  When the
buttons are pressed the application will be launched.  My problem is
that I want to have the icon that is associated with the application
to appear as the bitmap image on the toolbar.  I can extract the icon
but the CToolbarCtrl AddBitmap is expecting a CBitmap to be passed to
it.

My question is, does anyone have the steps needed to convert an ICON
to a BITMAP?





Jim Barry -- Jim.Barry@ilp.com
Monday, October 28, 1996

On 24 October 1996 18:37, Wayne G. Maas[SMTP:wgmaas@usa.nai.net] wrote:
> Environment: VC++ 4.2/Win95
>=20
> I've got a question I have not been able to find an answer for.
>=20
> I have an application that creates several CToolbarCtrl toolbars.=20
> Each button has an Windows application associated with it.  When the
> buttons are pressed the application will be launched.  My problem is
> that I want to have the icon that is associated with the application
> to appear as the bitmap image on the toolbar.  I can extract the icon
> but the CToolbarCtrl AddBitmap is expecting a CBitmap to be passed to
> it.
>=20
> My question is, does anyone have the steps needed to convert an ICON
> to a BITMAP?

1) Create a bitmap, select into a memory DC, call DrawIcon. Or

2) Get creative. Feed the icons into an ImageList with CImageList::Add. =
Get the ImageList bitmap with CImageList::GetImageInfo and use it for =
the toolbar.

Hope this helps.

- Jim





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