PNG Toolbar images are showing too small |
Post Reply |
Author | |
evoX
Senior Member Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Posted: 28 October 2008 at 2:28pm |
The images on toolbar are automatically scaled down from 48x48 to 16x16, so I get something like this the toolbar has 2 buttons (48x48), but both images appear on the first button. This is the toolbar source code:
CXTPCommandBars* pCommandBars = GetCommandBars(); pCommandBars->SetMenu(_T( "Menu Bar"), IDR_MAIN_MENU);CXTPToolBar* pToolBar = pCommandBars->Add(_T( "Main"), xtpBarBottom); if (!pToolBar || !pToolBar->LoadToolBar(IDR_TOOLBAR, FALSE)){
TRACE0( "Failed to create toolbar\n"); return -1;} XTPImageManager()->SetIcons(IDR_TOOLBAR, IDB_MAINTOOLBAR); pCommandBars->SetTheme(xtpThemeOffice2007); pCommandBars->GetCommandBarsOptions()->szLargeIcons = CSize(48, 48); pCommandBars->GetCommandBarsOptions()->bLargeIcons = TRUE; Why the images are not displayed at their original size of 48x48 pixels ?
Thanks !
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, paste IDR_TOOLBAR resource from rc file here.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
evoX
Senior Member Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
|
IDR_TOOLBAR TOOLBAR 48, 48
BEGIN BUTTON ID_MAIN_EXIT BUTTON ID_MAIN_TEST END ...I have also tried with IDR_TOOLBAR TOOLBAR MOVEABLE PURE 48,48 just like in WinZip GUI sample..., but I got the same result.
....and this is the menu
IDR_MAIN_MENU MENU
BEGIN POPUP "Main" BEGIN MENUITEM "E&xit", ID_MAIN_EXIT MENUITEM "Test", ID_MAIN_TEST END END |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, Looks right.What size IDB_MAINTOOLBAR bitmap has ?
also try step into SetIcons and check how many icons atually set.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
evoX
Senior Member Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
|
Hi,
The PNG bitmap is 288x48 pixels and in debugger SetIcons function loads 2 icons with the size of 48x48
I have tried a PNG with the size of 96x48 and now the bitmaps are displayed correctly !
It seems that SetIcons loads the entire bitmap, no matter what size you specify in szLargeIcons and then it just slices the bitmap according to the number of toolbar buttons and then it scales the image to fit in toolbar, very strange behaviour.
You should specify in documentation or in sample source code as a comment that // The Toolbar bitmap should be the exact size or it won't display correctly.
Thanks Oleg !
You have a great supprt !
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
ok :) |
|
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 |