CXTButtom::SetBitmap problem |
Post Reply |
Author | |
Vero
Groupie Joined: 25 May 2005 Location: Spain Status: Offline Points: 13 |
Post Options
Thanks(0)
Posted: 08 October 2009 at 4:31am |
Hello,
I have a problem with SetBitmap in a CXTButton.
I have next source:
m_button.SetBitmap(CSize(32,32), IDB_SAVE);
IDB_SAVE is a 32bpp (with alpha channel) bitmap added to my resources.
My problem is that I have the disabled button in black! In previous versions (v9.81) this works fine! Please, can you help me? |
|
Vero
|
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 886 |
Post Options
Thanks(0)
|
Not familiar with v9. But you might have to load the bitmap yourself and do the following:
BITMAP bm = {0}; ::GetObject( m_hbmImage, sizeof(bm), &bm );CBitmap bmpIcon; bmpIcon.Attach(m_hbmImage); // bmpIcon dtor will delete the GDI bitmap object for meCSize iconSize(bm.bmWidth, bm.bmHeight); // convert the bitmap to a transparent icon.HICON hIcon = CXTPTransparentBitmap(bmpIcon).ConvertToIcon(); CXTPImageManagerIconHandle hIconHandle; // do not set equal to hIcon here or it will NOT destrory the iconhIconHandle = hIcon; // Will call DestoyIcon - SetIcon will make a copy so that is OK;// call SetIcon member of xtpbutton
SetIcon(iconSize, hIconHandle, CXTPImageManagerIconHandle(), FALSE); |
|
Vero
Groupie Joined: 25 May 2005 Location: Spain Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Thanks
But why? In previous codeJock versions this works perfectly!
Anyone else have an answer?
|
|
Vero
|
|
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 |