![]() |
how to add an image to toolbar ? |
Post Reply ![]() |
Author | |
lovelypp ![]() Groupie ![]() Joined: 17 January 2008 Status: Offline Points: 34 |
![]() ![]() ![]() ![]() ![]() Posted: 25 September 2010 at 10:27am |
I want to display a Image (for example a led light) on the toolbar.
I have added a bmp resource (its id is IDB_RED_LED).
How?
thanks!
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
you want to stretch it ? check CustomThemes sample - it shows how to override paintmanagers for such things.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
lovelypp ![]() Groupie ![]() Joined: 17 January 2008 Status: Offline Points: 34 |
![]() ![]() ![]() ![]() ![]() |
We want to display a led-on or a led-off (light) picture on the toolbar area. which just is a picture and not clickable. it's well if it can be stretched. how?
thanks
|
|
![]() |
|
lovelypp ![]() Groupie ![]() Joined: 17 January 2008 Status: Offline Points: 34 |
![]() ![]() ![]() ![]() ![]() |
I use the following code:
// Create ToolBar
CXTPToolBar* pToolBar = (CXTPToolBar*)pCommandBars->Add(_T("标准工具栏"), xtpBarTop); if(!pToolBar || !pToolBar->LoadToolBar(IDR_MAINFRAME)) { TRACE0("Failed to create toolbar\n"); return -1; } m_wndLed.Create(_T(""), WS_CHILD | WS_VISIBLE | SS_BITMAP | SS_CENTERIMAGE, CRect(0, 0, 16, 16), this); CXTPControlCustom* pLedControl = CXTPControlCustom::CreateControlCustom(&m_wndLed); pToolBar->GetControls()->Add(pLedControl); where m_wndLed is of CBitmapPicture from codeguru which support transparent.
now the image is added correctly, but does not display correctly. see the following image:
![]() |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Try CXTPControlLabel instead. Set its ID to some ID_LED and set this bitmap to imagemaanger of CommandBars.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |