Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - How can i put my own bitmap on a button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How can i put my own bitmap on a button

 Post Reply Post Reply
Author
Message
vijaymahajan View Drop Down
Groupie
Groupie
Avatar

Joined: 16 June 2008
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote vijaymahajan Quote  Post ReplyReply Direct Link To This Post Topic: How can i put my own bitmap on a button
    Posted: 23 June 2008 at 8:07am
Hello,
How can i put a (32,32 pixel) bitmap images on the button.
you have put a png file in your sample application. i want a full size button as your "insert caption button" under Referrence tab in your ribbonsample application.
currently i am creating a button using this code -

CXTPControl* pcontrol = pGroup1->Add(xtpControlButton, ID_EDIT_NEW1);

this bitmap file is 32*32 pixels.But its not working.
 
Please explain me,how can we put out bitmaps on the buttons.
Please guide in detail.
 
Thanks And regards,
Vijay. 
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: 23 June 2008 at 11:34am
Hi,
 
See Samples\Ribbon\RibbonControls  sample from 12.0 release.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
vijaymahajan View Drop Down
Groupie
Groupie
Avatar

Joined: 16 June 2008
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote vijaymahajan Quote  Post ReplyReply Direct Link To This Post Posted: 24 June 2008 at 1:28am

i am trying to put a my .bmp file on a button. but its not working.i am doing this way -

CXTPRibbonTab* pTabEdit = pRibbonBar->AddTab(_T("Edit"));CXTPRibbonGroup* pGroup1 = pTabEdit->AddGroup(ID_GROUP_TRIAL);CXTPControl* pcontrol = pGroup1->Add(xtpControlButton, ID_EDIT_BTN);pcontrol->SetStyle(xtpButtonIcon);pcontrol->SetWidth(40);pcontrol->SetHeight(60);pCommandBars->GetImageManager()->SetIcon(ID_EDIT_NEW1,ID_EDIT_BTN,CSize(32,32),xtpImageNormal);

Here this ID_EDIT_NEW1 is the id of bitmap file.and ID_EDIT_BTN is the id of button created.
Please guide me to put my bitmap files on the button control.
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: 24 June 2008 at 9:32am
Hi,
 
SetIcon metohd works only for ico files.   you need SetIcons method. See how sample load bitmaps.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.047 seconds.