XTP crashes with bitmaps with alpha channels! |
Post Reply |
Author | |
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
Posted: 26 January 2007 at 11:40am |
I've got several reports that the application crashes after the upgrade to 10.40.
I was able to reproduce the crash and to track it down. It crashes as soon as I add a bitmap (.bmp, not .png) with an alpha channel to the QAT. It doesn't crash on every PC but I've been able to reproduce it on a clean Win2K SP2 English installation. In the RibbonSample add a CBitmap m_bitmap; to the CMainFrame class and in LoadIcons add the following lines: void CMainFrame::LoadIcons () { CXTPCommandBars* pCommandBars = GetCommandBars(); HANDLE hBitmap = ::LoadImage (NULL, _T("EditUndo.bmp"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE); m_bitmap.Attach (hBitmap); UINT nId = ID_EDIT_UNDO; pCommandBars->GetImageManager()->SetIcons(m_bitmap, &nId, 1, CSize(16,16), xtpImageNormal, TRUE); // .... } I've attached the modified files as well as the bitmap. uploads/20070126_113431_Crash.zip |
|
Codejock support
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Add LR_CREATEDIBSECTION flag for LoadImage call.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
... You can call CXTPImageManagerIcon::LoadBitmapFromFile that automatically detect if it has Alpha channel/png file.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
Hello Oleg,
have you been able to reproduce the crash? Andre |
|
Codejock support
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
No.
But I sure reason in LR_CREATEDIBSECTION.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
That avoids the crash, but transparency doesn't work. No problem on W2k SP4, only W2k SP2 here, but others have reported the problem also with W2k SP4 and XP Home. |
|
Codejock support
|
|
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 |