Print Page | Close Window

How can i put my own bitmap on a button

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=11155
Printed Date: 01 March 2025 at 12:03am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How can i put my own bitmap on a button
Posted By: vijaymahajan
Subject: How can i put my own bitmap on a button
Date 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. 



Replies:
Posted By: Oleg
Date Posted: 23 June 2008 at 11:34am
Hi,
 
See Samples\Ribbon\RibbonControls  sample from 12.0 release.


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


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


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



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