Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Set Image for CXTP Button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Set Image for CXTP Button

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


Joined: 07 May 2008
Status: Offline
Points: 117
Post Options Post Options   Thanks (0) Thanks(0)   Quote barobax Quote  Post ReplyReply Direct Link To This Post Topic: Set Image for CXTP Button
    Posted: 13 March 2009 at 10:28am
Hi All,
How can I set a file for button bitmap ?!?

Thanks in Advance.
Back to Top
barobax View Drop Down
Senior Member
Senior Member


Joined: 07 May 2008
Status: Offline
Points: 117
Post Options Post Options   Thanks (0) Thanks(0)   Quote barobax Quote  Post ReplyReply Direct Link To This Post Posted: 13 March 2009 at 5:15pm
hi alll,

I need set a CXTPButton bitmap ?!? I have a file on disk and it's name is image_ce.png and I want to set it to draw on my CXTPButton

Please help me,
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: 16 March 2009 at 7:26am
You need this method
BOOL CXTPButton::SetIcon(CSize size, const CXTPImageManagerIconHandle& hIcon, const CXTPImageManagerIconHandle& hIconHot, BOOL bRedraw/*= TRUE*/)
and
CXTPImageManagerIcon::LoadBitmapFromFile
to load bitmap.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
barobax View Drop Down
Senior Member
Senior Member


Joined: 07 May 2008
Status: Offline
Points: 117
Post Options Post Options   Thanks (0) Thanks(0)   Quote barobax Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2009 at 3:48pm
Hi oleg,
Thanks for your response, I tried to load PNF file format but it's did not successful and throw exception. CXTPImageManagerIconHandle var did not load HBITMAP

please help me,
Thanks in Advance.
Back to Top
barobax View Drop Down
Senior Member
Senior Member


Joined: 07 May 2008
Status: Offline
Points: 117
Post Options Post Options   Thanks (0) Thanks(0)   Quote barobax Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2009 at 5:26pm
it's my code

    HBITMAP hBitmap = CXTPImageManagerIcon::LoadBitmapFromFile(sFile);
    CXTPImageManagerIconHandle icoHandle = CXTPImageManagerIconHandle(hBitmap);
    m_Button_CE.SetIcon(CSize(20, 20), icoHandle);
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: 17 March 2009 at 1:39am
Hi,
 
Check if hBitmap is not NULL after first line. Are you sure path is correct ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
barobax View Drop Down
Senior Member
Senior Member


Joined: 07 May 2008
Status: Offline
Points: 117
Post Options Post Options   Thanks (0) Thanks(0)   Quote barobax Quote  Post ReplyReply Direct Link To This Post Posted: 17 March 2009 at 2:17am
Hi,
My hBitmap is not NULL and my path is correct.
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.063 seconds.