![]() |
how to set icon/png to an button |
Post Reply
|
| Author | |
himanshu
Groupie
Joined: 04 January 2008 Status: Offline Points: 81 |
Post Options
Thanks(0)
Quote Reply
Topic: how to set icon/png to an buttonPosted: 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
|
|
![]() |
|
himanshu
Groupie
Joined: 04 January 2008 Status: Offline Points: 81 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 March 2008 at 12:53am |
|
hi
any solution to this?
|
|
![]() |
|
himanshu
Groupie
Joined: 04 January 2008 Status: Offline Points: 81 |
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
himanshu
Groupie
Joined: 04 January 2008 Status: Offline Points: 81 |
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
himanshu
Groupie
Joined: 04 January 2008 Status: Offline Points: 81 |
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
himanshu
Groupie
Joined: 04 January 2008 Status: Offline Points: 81 |
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 10 March 2008 at 4:30am |
|
Just set it to NULL.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
himanshu
Groupie
Joined: 04 January 2008 Status: Offline Points: 81 |
Post Options
Thanks(0)
Quote Reply
Posted: 18 March 2008 at 7:01am |
|
how to set it to some value other than NULL
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 March 2008 at 8:27am |
|
I need same to check what you do. |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |