resourcemanager and icons

  • Thread starter Thread starter Lance Johnson
  • Start date Start date
L

Lance Johnson

We have icon files that have 16x16, 24.24, and 32x32 icon sizes in each
file...So each file has the 3 different sizes. If we put the icon into the
resourcemanager will we be able to use the 3 different sizes, or do we
somehow have to get the 3 different sizes into the resouremanager as
different items? I'm not very experienced in graphics stuff, but we know
something's not right with sizing the icon we retrieve and I think it's
because not all 3 icon sizes are really in the resource manager.

Lance Johnson
 
Hi Lance,


Base on my research, it depends on how the data is serialized, If you add
the icon file into an Image property, it will only serialize the first
image in the icon file.
If you set the icon file to an Icon property or embed it as a resource,
then it will serialize all the icon data, then you may get a image of
certain size by:

System.Resources.ResourceManager rs = new
System.Resources.ResourceManager(GetType());
Icon icon = new Icon((Icon)rs.GetObject("$this.Icon"),24,24);
pictureBox1.Image = icon.ToBitmap();


Does it answer your question?
Please feel free to reply this thread, iIf you have anything unclear on
this issue.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
We are using the ResourceEditor that comes down in the VS.Net directory
structure. Does this correctly store the icon with the 3 states when using
this utility?

Lance Johnson
 
Hi Lance,

Do you mean the ImageEditor in the VS.NET IDE?
Yes, it could store the multiple bitmaps into icon file correctly.
However from my understanding, your original questions are more about the
ResourceManager in .NET...
If you have further questions on this issue, please feel free to reply this
thread.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
I don't mean the imageeditor. I mean the Resource Editor as I previously
mentioned. For help in locating this you can look at:

C:\Program Files\Microsoft Visual Studio .NET
2003\SDK\v1.1\Samples\Tutorials\resourcesandlocalization\reseditor

This is the location on a default install.


Lance Johnson
 
Hi Lance,


Yes,the Resource Editor can store the icon file correctly, if you add the
resouce as Icon.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
Back
Top