Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Task Panel
  New Posts New Posts RSS Feed - Unable to display icon for item - Part 2
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Unable to display icon for item - Part 2

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


Joined: 16 February 2007
Location: Taiwan
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote iron1103 Quote  Post ReplyReply Direct Link To This Post Topic: Unable to display icon for item - Part 2
    Posted: 16 February 2007 at 7:05am
 Hi,
 
Here is my problem, when I use SetIcon() in this way, it works fine,
 
 
CXTPTaskPanelGroupItem *pItem;
CXTPImageManagerIconHandle hicon( AfxGetApp()->LoadIcon(IDI_ICON) );
m_TaskPanel.GetImageManager()->SetIcon( hicon, pItem->GetID() );
 
 
But in this way, it won't display the icon,
 
 
CXTPTaskPanelGroupItem *pItem;
HICON hicon = AfxGetApp()->LoadIcon(IDI_VEC);
HBITMAP hbmp = MyFunction( hicon );
CXTPImageManagerIconHandle xtpicon( hbmp );
m_TaskPanel.GetImageManager()->SetIcon( xtpicon, pItem->GetID() );
 
 
And I chased the source code,
 
 
CXTPImageManagerIcon::PreMultiplyAlphaBitmap()
{
   TRY
   {
      hBitmapAlpha = CreateDIBSection(dcSrc, pBitmapInfo, DIB_RGB_COLORS, (void**)&pDest, NULL, 0);
   }
}
 
I use CDC.BitBlt() to see the hBitmapAlpha, it's totally black.
 
Did I miss something ??  Please help me.
 
 
 Happy Chinese New Year !!
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: 16 February 2007 at 9:12am
Hi,
If yo use CXTPImageManagerIconHandle xtpicon( hbmp ); ImageManager assumes that hbmp  is 32bit alpha bitmap.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
iron1103 View Drop Down
Newbie
Newbie


Joined: 16 February 2007
Location: Taiwan
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote iron1103 Quote  Post ReplyReply Direct Link To This Post Posted: 18 February 2007 at 12:31pm
oh..  it could be the answer..
 
thank you..  i will check my bitmap files
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.203 seconds.