Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Alpha channel doesn't work with Vista black...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Alpha channel doesn't work with Vista black...

 Post Reply Post Reply
Author
Message
ddlittle View Drop Down
Senior Member
Senior Member


Joined: 19 February 2004
Location: United States
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddlittle Quote  Post ReplyReply Direct Link To This Post Topic: Alpha channel doesn't work with Vista black...
    Posted: 19 July 2008 at 1:57pm
I don't know if it's a black problem or not, but my alpha channel on my custom icons looks like a big black hole around the icons.  I've noticed in other places in this forum that i should stop using CImageList, but I'm not sure how to do that.  Here's my icon loading code (I load icons from a resource-only DLL so I can share between apps):
 

 HINSTANCE iconInst = (HINSTANCE)LoadLibrary(<someDLLname>);
 if(iconInst)
 {
  CImageList imgList32;
  CImageList imgList16;
  HRESULT hr;
  imgList32.Create(32,32,ILC_COLORDDB|ILC_MASK,0,1);
  imgList16.Create(16,16,ILC_COLORDDB|ILC_MASK,0,1);
  stdButtons = new UINT[btnCount];
  int howMany32=0;
  int howMany16=0;
  for(int x=0;x<btnCount;x++)
  {
   stdButtons[x] = iconIds[x].cmd;
   HICON hIcon = ::LoadIcon(iconInst,MAKEINTRESOURCE(iconIds[x].icon));
   if(!hIcon)
   {
    hIcon = AfxGetApp()->LoadStandardIcon(IDI_QUESTION);
   }
   howMany32 = imgList32.Add(hIcon);  // load the 32x32 one
   howMany16 = imgList16.Add(hIcon);  // and the 16x16
  }
  // now set both sizes of the images for XTP...
  hr= XTPImageManager()->SetIcons((CImageList&)imgList32,stdButtons,btnCount,CSize(32,32));
  hr= XTPImageManager()->SetIcons((CImageList&)imgList16,stdButtons,btnCount,CSize(16,16));
 
Any ideas?
 
Thanks!
 
- David
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 2008 at 4:05am
yes, don't use CImageList to load icons.
 
set icons directly
 
CXTPImageManagerIconHandle hIcon;
hIcon.CreateIconFromResource(iconInst, iconIds[x].cmd,    szResourceIcon, FALSE)
 
XTPImageManager()->SetIcon(hIcon, cmd);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ddlittle View Drop Down
Senior Member
Senior Member


Joined: 19 February 2004
Location: United States
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddlittle Quote  Post ReplyReply Direct Link To This Post Posted: 21 July 2008 at 10:53am

That worked great for everything except for the report column icons.  Those come from an image list and I don't see a method in CXTPReportColumn that uses an icon. 

Any ideas on that?
 
Thanks!  I was thinking I was going to have to have somebody redraw all my icons...
 
- David
 
 
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 2008 at 1:08pm
Hi,
 
use wndReportControl.GetImageManager() to get ImageManager of report.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ddlittle View Drop Down
Senior Member
Senior Member


Joined: 19 February 2004
Location: United States
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddlittle Quote  Post ReplyReply Direct Link To This Post Posted: 21 July 2008 at 3:39pm
Cool, that works fine as long as I only load the 16x16 size, but that's the size I need anyway.  Now my app is very nice looking.  
 
- David
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.140 seconds.