Print Page | Close Window

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

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=11496
Printed Date: 05 July 2024 at 10:16am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Alpha channel doesn't work with Vista black...
Posted By: ddlittle
Subject: Alpha channel doesn't work with Vista black...
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: ddlittle
Date 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
 
 


Posted By: Oleg
Date Posted: 21 July 2008 at 1:08pm
Hi,
 
use wndReportControl.GetImageManager() to get ImageManager of report.


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


Posted By: ddlittle
Date 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



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