Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Alpha icons look bad in Disabled state
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Alpha icons look bad in Disabled state

 Post Reply Post Reply
Author
Message
Stephen12 View Drop Down
Newbie
Newbie


Joined: 20 July 2005
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Stephen12 Quote  Post ReplyReply Direct Link To This Post Topic: Alpha icons look bad in Disabled state
    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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Stephen12 View Drop Down
Newbie
Newbie


Joined: 20 July 2005
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Stephen12 Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 21 July 2005 at 11:21pm
Right :)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.110 seconds.