![]() |
SetIcons from resource DLL? |
Post Reply
|
| Author | |
evoX
Senior Member
Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Quote Reply
Topic: SetIcons from resource DLL?Posted: 01 October 2010 at 12:43am |
|
How can I load bitmaps from a Resource DLL file for Markup?
I have this, but I want to load the bitmap from a different DLL.
XTPImageManager()->SetIcons(IDB_PNG_XAML_SYSINFO, &nIDSysInfo, 1, 0);
|
|
|
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit Language: Visual C++ (VS 2019) |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 October 2010 at 2:45am |
|
Hi,
You can first load bitmap and add it with XTPImageManager()->SetIcons(&bmp, ...) method.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
evoX
Senior Member
Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 October 2010 at 5:45am |
|
Hi,
Is there a function in ToolkitPro to load the bitmap from a different resource DLL or I need to make my own?
|
|
|
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit Language: Visual C++ (VS 2019) |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 October 2010 at 8:19am |
|
Hi, you can use static HBITMAP CXTPImageManagerIcon::LoadBitmapFromResource(HMODULE hModule, LPCTSTR lpszResource, BOOL* lbAlphaBitmap); method. |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
evoX
Senior Member
Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 October 2010 at 12:21pm |
|
Thanks !
|
|
|
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit Language: Visual C++ (VS 2019) |
|
![]() |
|
evoX
Senior Member
Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 January 2011 at 11:02am |
|
I have tried this, but it does not work :( UINT nIDSysInfo=1; hResourceInstance=LoadLibrary(_T( "HardRes.dll"));bmpChassis.FromHandle(CXTPImageManagerIcon::LoadBitmapFromResource(hResourceInstance, MAKEINTRESOURCE(IDB_LOGO_CHASSIS), &bAlpha)); XTPImageManager()->SetIcons(bmpChassis, &nIDSysInfo, 1, CSize(70,107)); // if I use bmpChassis.GetDimensions() instead of CSize it crashes FreeLibrary(hResourceInstance); |
|
|
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit Language: Visual C++ (VS 2019) |
|
![]() |
|
ddlittle
Senior Member
Joined: 19 February 2004 Location: United States Status: Offline Points: 132 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 January 2011 at 2:03pm |
|
Here's a couple of ways I do this in my code. Hope it helps..
My icons are .ICOs in a resource file, loaded like this:
CXTPImageManagerIconHandle hIcon; hIcon.CreateIconFromResource(iconInst,MAKEINTRESOURCE(iconIds[x].icon),sz32, TRUE); XTPImageManager()->SetIcon(hIcon,iconIds[x].cmd); I load a PNG and attach it to my menu with this code: UINT nCommands2[] = {IDB_LOGO};CXTPImageManagerIcon hIcon(IDB_LOGO,0,0); BOOL b = TRUE; HBITMAP bm = hIcon.LoadBitmapFromResource(instResource,MAKEINTRESOURCE(IDB_C2RLOGO),&b); CBitmap cbm; cbm.Attach(bm); b = GetCommandBars()->GetImageManager()->SetIcons(cbm, nCommands2,_countof(nCommands2) ,CSize(0,0), xtpImageNormal, TRUE); FreeLibrary(instResource); |
|
![]() |
|
evoX
Senior Member
Joined: 25 July 2007 Status: Offline Points: 207 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 January 2011 at 3:56pm |
|
thanks, with Attach bitmap it worked.
|
|
|
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit Language: Visual C++ (VS 2019) |
|
![]() |
|
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 |