Print Page | Close Window

Alpha icons look bad in Disabled state

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=2611
Printed Date: 05 July 2024 at 10:03am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Alpha icons look bad in Disabled state
Posted By: Stephen12
Subject: Alpha icons look bad in Disabled state
Date Posted: 20 July 2005 at 3:59pm

Platform: XTpro 9.6, Win XP SP2, VS2003

Problem: I am trying to use alphablended icons from (.ICO) files. They work as expected in a normal state on Whidbey and Office2003, but they look bad when they are disabled (They have black pixels around them). I have

 bUseDisabledIcons = TRUE

 

What did I try?

I took some of this icons and brought them into your CommandBarsIcon sample as a resource and set them for some of the MenuItems using

SetIcon(nResouceID, nCommandID)

 

 They look the same as in my app (bad - again, only when they are disabled) while alpha icons you have in that sample look good . I was going to compare colors and opacity of pixels, but I cannot open your alphaclr.bmp file with VS2003 resource editor (>256 colors), nor with your Designer Studio. I played also with SetMaskColor using black instead of your default green, but that didn't give me a desired result.

I would appreciate any help on this.

Thanks in advance




Replies:
Posted By: Oleg
Date Posted: 21 July 2005 at 7:54am
Are you sure you have "alphablended" icons? Please attach one here to see.

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


Posted By: Stephen12
Date Posted: 21 July 2005 at 10:45am

Thanks for the quick response! I've got to apologize. I found what the problem was and I didn't even post the problem right.

Icons are alpha blended, however it was the way they were loaded that was causing the problem.  I made a mistake when I was trying to put them in your CommandBarsIcon example to try with icon that I already processed with some tools and made them non-alpha (That is why bad look with SetIcon(resourceId, commandID).  The rest from the problem was OK.

 I discovered that because when I tried some more that I was going to send you in reply they worked. But, they didn't work in my app because of the way of loading from file. I couldn't use resources so I opened them with LoadImage and passed the handle to your SetIcon:

HICON hIcon = (HICON) LoadImage(NULL, sFilename,

IMAGE_ICON, 0, 0, LR_DEFAULTSIZE |LR_LOADFROMFILE);

if(hIcon) XTPImageManager()->SetIcon(hIcon, ID_BLAHBLAH);

 

, while proper way was this:

XTPImageManager()->SetIcon(CXTPImageManagerIconHandle(CXT PImageManagerIcon::LoadAlphaIcon(sFileName, 0)), ID_BLAHBLAH);

Regards



Posted By: Oleg
Date Posted: 21 July 2005 at 11:21pm
Right :)

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



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