![]() |
how to set icon/png to an button |
Post Reply ![]() |
Author | |
himanshu ![]() Groupie ![]() Joined: 04 January 2008 Status: Offline Points: 81 |
![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
|
himanshu ![]() Groupie ![]() Joined: 04 January 2008 Status: Offline Points: 81 |
![]() ![]() ![]() ![]() ![]() |
hi
any solution to this?
|
|
![]() |
|
himanshu ![]() Groupie ![]() Joined: 04 January 2008 Status: Offline Points: 81 |
![]() ![]() ![]() ![]() ![]() |
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 ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() ![]() |
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 |
![]() ![]() ![]() ![]() ![]() |
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 ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Just set it to NULL.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
himanshu ![]() Groupie ![]() Joined: 04 January 2008 Status: Offline Points: 81 |
![]() ![]() ![]() ![]() ![]() |
how to set it to some value other than NULL
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |