Print Page | Close Window

32BPP Image Lists in XTPButton

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=14331
Printed Date: 29 May 2024 at 2:18am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: 32BPP Image Lists in XTPButton
Posted By: AndyS
Subject: 32BPP Image Lists in XTPButton
Date Posted: 19 May 2009 at 7:21am

The following works for getting a strip of four alpha icons onto my CXTPButtons....

m_bmpIcons.LoadBitmap(IDB_STRIP_XYZ);

m_imageList.Create(16, 16, ILC_COLOR32, 4, 1);

m_imageList.Add(&m_bmpIcons, RGB(0,0,0));

...
m_cBtnA.SetIcon(CSize(16,16), m_imageList.ExtractIcon(0)
m_cBtnB.SetIcon(CSize(16,16), m_imageList.ExtractIcon(1)
m_cBtnC.SetIcon(CSize(16,16), m_imageList.ExtractIcon(2)
m_cBtnD.SetIcon(CSize(16,16), m_imageList.ExtractIcon(3)
 
 
The problem is that when the button control is disabled the transparent parts render as black. I see the button sample uses discrete bitmaps for each button and that works fine here too but I'd prefer to use an image strip rather than tens of seperate bitmap resources. Can this be done?
 
Thanks
 
 



Replies:
Posted By: AndyS
Date Posted: 19 May 2009 at 9:10am
I think I may have resolved this myself. The problem appears to be in the way CXTPImageManagerIconHandle treats the automatic construction of the disabled icons. The assumption of alpha capability within the CXTPImageManagerIconHandle appears to be driven by whether the icon handle was initialised from an HICON or from an HBITMAP. I guess that's a throwback to before ImageList icons handled alpha.
 
The fix for me is to always use set the icon from a bitmap but I'd still like to use image strips. For now I've knocked up a support method which pulls a region of the strip bitmap out and uses that to set the bitmap on the button. This keeps my icons in easy to handle strips and avoids image lists entirely.
 
If I've got this wrong please let me know, or if there's some support methods for single bitmap extraction from toolbar strips already in codejock then that would be good to.


Posted By: Oleg
Date Posted: 20 May 2009 at 2:16am
Hi,
 
Yes, load images from bitmap or icon directly - standard ImageList support 32bit icons from WindowsXP only.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Vero
Date Posted: 08 October 2009 at 4:04am
Hello,
 
I have the same problem whith SetBitmap in a CXTButton.  With next source:
 

m_buttonSave.SetBitmap(CSize(32,32), IDB_SAVE);

I have the disabled button in black because the bitmap is 32bpp.

In previous versions (v9.81) this works fine! Please, can you help me?


-------------
Vero



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net