Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > General Discussion
  New Posts New Posts RSS Feed - How mix 2 CXTPImageManagerIconHandle?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How mix 2 CXTPImageManagerIconHandle?

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


Joined: 05 October 2008
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote zitz Quote  Post ReplyReply Direct Link To This Post Topic: How mix 2 CXTPImageManagerIconHandle?
    Posted: 12 November 2009 at 2:33am
I get 2 icons from CXTPImageManager (Is Alpha icons), I want Apply(mix/impose/lay on/наложить) one icon to another, and add to CXTPImageManager.

I have
CXTPImageManagerIconHandle h1;
and
CXTPImageManagerIconHandle h2;
I want to get
CXTPImageManagerIconHandle h3 = Mix( h1, h2 );

How?
Xtreme ToolkitPro v13.1.0, static, VC++6
Back to Top
zitz View Drop Down
Senior Member
Senior Member


Joined: 05 October 2008
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote zitz Quote  Post ReplyReply Direct Link To This Post Posted: 29 January 2010 at 7:54am
Solved!
I use this function to get HICON:
HICON CreateIconFromImageManagerIconHandle( CXTPImageManagerIconHandle& hHandle )
{
    class CXTPImageManagerIconHandleCreateIcon : public CXTPImageManagerIconHandle
    {
    public:
        HICON CreateHICON()
        {
            if ( m_hIcon != NULL )
            {
                return ::CopyIcon( m_hIcon );
            }
            else if ( m_pRInfo != NULL )
            {
                CXTPImageManagerIconHandleCreateIcon hHandle;
                m_pRInfo->pResource->CreateIcon( hHandle, m_pRInfo );
                return hHandle.CreateHICON();
            }
            else if ( m_hBitmap != NULL )
            {
                if ( m_pBits != NULL )
                {
                    CXTPImageManagerIconHandleCreateIcon hHandle;
                    hHandle.CopyHandle( m_hBitmap );
                    return hHandle.CreateHICON();
                }
                if ( m_szIcon.cx > 0 && m_szIcon.cy )
                {
                    CImageList il;
                    il.Create( m_szIcon.cx, m_szIcon.cy, ILC_COLOR32, 0, 1 );
                    il.Add( CBitmap::FromHandle( m_hBitmap ), (CBitmap*)NULL );
                    return il.ExtractIcon( 0 );
                }
            }
            return NULL;
        }
    };
    CXTPImageManagerIconHandleCreateIcon& hIcon = (CXTPImageManagerIconHandleCreateIcon&)hHandle;
    return hIcon.CreateHICON();
}
Xtreme ToolkitPro v13.1.0, static, VC++6
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.187 seconds.