Print Page | Close Window

CXTButton bitmap (BMP) transparency

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3101
Printed Date: 09 November 2025 at 5:11am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTButton bitmap (BMP) transparency
Posted By: thodgson
Subject: CXTButton bitmap (BMP) transparency
Date Posted: 26 October 2005 at 1:56pm

Is there a way to specify the transparency color of a bitmap for an icon specified for a CXTButton?

I've noticed that the color is determined by the color at pixel point 0,0 - maybe this is wrong but...



-------------
Tim H( http://www.ExclamationSoft.com - http://www.ExclamationSoft.com )
Product: Xtreme Toolkit v13.1
Platform: Vista(x64)-SP1
Language: Visual C++ 6.0
Currently: Satisfied w/ Toolkit



Replies:
Posted By: Oleg
Date Posted: 27 October 2005 at 7:02am

There is no way :(

Can suggest you manually convert it to icon and use SetIcon with hIcon parameter:

 

 CImageList il;
 il.Create(bmp.bmWidth, bmp.bmHeight, ILC_COLOR24 | ILC_MASK, 0, 1);
 il.Add(CBitmap::FromHandle(m_hBitmap), crTransparent);

 ASSERT(il.GetImageCount() == 1);

 il.ExtractIcon(0);



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


Posted By: thodgson
Date Posted: 27 October 2005 at 9:00am


Okay, that will work.


-------------
Tim H( http://www.ExclamationSoft.com - http://www.ExclamationSoft.com )
Product: Xtreme Toolkit v13.1
Platform: Vista(x64)-SP1
Language: Visual C++ 6.0
Currently: Satisfied w/ Toolkit



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