Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I'm using a series of Icons as Embedded Resources. I've several difference sizes of the same icon, e.g. Customer16.ico, Customer32.ico... etc.

 

Is there a way of extracting the required icon from a single icon file?

  • *Gurus*
Posted

To this, you first create your source icon, I assume using the stream returned by GetManifestResourceStream. I take it you're doing this already. You then use the following to extract the different sized icons from it:

 

iconLarge = New Icon(iconSource, New Size(32, 32))
iconSmall = New Icon(iconSource, New Size(16, 16))

 

iconLarge = new Icon(iconSource, new Size(32, 32));
iconSmall = new Icon(iconSource, new Size(16, 16));

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...