![]() |
Loading XP Icons from resource |
Post Reply
|
| Author | |
andre
Groupie
Joined: 09 March 2005 Status: Offline Points: 27 |
Post Options
Thanks(0)
Quote Reply
Topic: Loading XP Icons from resourcePosted: 13 September 2005 at 8:13am |
|
Hi, Is there anyway to load XP icons( not bitmaps ) from resource ? Xtreme has a very nice function HBITMAP CXTPImageManagerIcon::LoadAlphaIcon(LPCTSTR pszFileName, int nWidth), but it only loads icons from a file. I build my own LoadAlphaIcon( HINSTANCE h, LPCSTR sid, int w ), but I want to know if it is there anyway simpler to do it, because I had to add the icons to a diferent resource group than ICON. myresource.rc <..> DELETE IMAGE DISCARDABLE "res\delete.ico" <..> An this raises another question, why do Visual studio seems to damage( remove alpha layer ) on XP icons when they are added to the ICON group on the resource ? Thankx André moreira |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 September 2005 at 2:09pm |
|
In 9.70 was added simple SetIcon(IconId, CommandId) That loads alpha icon. |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
andre
Groupie
Joined: 09 March 2005 Status: Offline Points: 27 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 September 2005 at 2:58pm |
|
Hi Oleg, thankx, But I did no found any sample that actualy loads a XP Icon( with alpha layer ) from the resource( RT_GROUP_ICON ), is there any sample ? <...> SetIcon( IDI_ICON, 0x100 ); // where IDI_ICON is a XP Icon <...> I did however found a lot of bitmap and toolbars examples but that's not what I need. Actualy one of the reasons that I insist on icons and not bitmaps, is that the Icon is much easer to deal with and much smaller than bitmaps on the resource, ( it probably have some kind of compression ) ? And also one the reasons I do not use SetIcon is because I think Visualstudio 6 does not like icons with alpha layer( not just 16milion ), everytime I add one, the alpha layer is damaged. That is why I need to see a sample to see how it's done. André
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 September 2005 at 11:53pm |
|
Hi, So SetIcon call don't work in your application? Can you attach ico file you use may be problem in it? Don't open it in Visual Studio IDE and it won't damage it.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
andre
Groupie
Joined: 09 March 2005 Status: Offline Points: 27 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 September 2005 at 2:29pm |
|
Hi Oleg, A small bug... HBITMAP CXTPImageManagerIcon::LoadAlphaIcon(LPCTSTR pszFileName, int nWidth) HANDLE hFile = CreateFile(pszFileName, GENERIC_READ, 0, NULL, if (!hFile) should be... if (hFile==INVALID_HANDLE_VALUE)
|
|
![]() |
|
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 |