Print Page | Close Window

how to set icon/png to an 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=9805
Printed Date: 07 June 2024 at 10:06am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how to set icon/png to an button
Posted By: himanshu
Subject: how to set icon/png to an button
Date Posted: 06 March 2008 at 2:20am
I am working on a ribbonbar application wherein i have different tabs inside it
 
Each tab contains xtpControlButton inside it
 
I want to set a png file for each one of them .How could i load them at runtime.
 
I have not included it inside the .rc file
 
Thanks in advance
Himanshu



Replies:
Posted By: himanshu
Date Posted: 07 March 2008 at 12:53am
hi
 
any solution to this?


Posted By: himanshu
Date Posted: 07 March 2008 at 4:59am
in the ribbonbar sample example pngs are loaded using below

UINT uiGroupFind[] = {ID_EDIT_FIND, ID_EDIT_REPLACE, ID_EDIT_GOTO, ID_EDIT_SELECT};

pCommandBars->GetImageManager()->SetIcons(ID_GROUP_FIND, uiGroupFind, _countof(uiGroupFind), CSize(16, 16));

 

what if i have not added this png to resource file.

I want some other method which will load this png file given the full path of this file on the disk.
Any method which will take the file path as argument. 
 
thanks


Posted By: Oleg
Date Posted: 07 March 2008 at 3:17pm

Hi,


1. HBITMAP AFX_CDECL CXTPImageManagerIcon::LoadBitmapFromFile(LPCTSTR lpszFileName, BOOL* lbAlphaBitmap) to load bitmap
2. GetImageManager()->SetIcons(..) to  add it to imagemanager.
3. DeleteObject to destroy


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


Posted By: himanshu
Date Posted: 10 March 2008 at 4:09am
hi
 
thanks..
 
what do the BOOL*lbAlphaBitmap do by default it is null
how to set it to some different value as for lbAlphaBitmap=0 image is shown as black and white


Posted By: himanshu
Date Posted: 10 March 2008 at 4:10am
hi
 
what is the use of lbAlphaBitmap.
LoadBitmapFromFile(LPCTSTR lpszFileName, BOOL* lbAlphaBitmap=0)
by default images is shown as black and white .how to set it to different value


Posted By: himanshu
Date Posted: 10 March 2008 at 4:12am
hi
 
what is the use of lbAlphaBitmap.
LoadBitmapFromFile(LPCTSTR lpszFileName, BOOL* lbAlphaBitmap=0)
by default images is shown as black and white .how to set it to different value


Posted By: Oleg
Date Posted: 10 March 2008 at 4:30am
Just set it to NULL.

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


Posted By: himanshu
Date Posted: 18 March 2008 at 7:01am
how to set it to some  value other than NULL


Posted By: Oleg
Date Posted: 19 March 2008 at 8:27am

I need same to check what you do.



-------------
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