Does .NET have icon collections?
Asked Answered
C

11

77

Does .NET framework have a collection of icons for use in Windows Forms or WPF application somewhere? How does one use it? For example, how do I use it as an application window icon?

I recall, if you want to display a message box there is a choice to show different icons, I suppose there are more icons in the framework?

Contain answered 10/11, 2010 at 7:39 Comment(0)
C
71

If you're using a full edition (not Express) of Visual Studio, an image library is included for you to use freely in your applications (including commercial products!). The primary advantage of using icons from this library is that they are very similar or identical to those that are used in Windows and other Microsoft products, such as Office and Visual Studio, so your users will find them very familiar. This library includes images, icons, and animations and is installed on your computer when you install Visual Studio. For example, if you're using VS 2010, the image library is located here:

..\Program Files\Microsoft Visual Studio 10.0\Common7\VS2010ImageLibrary\1033

To use the files, you first need to extract them from the zip file.

See this entry on th Visual Studio Team Blog site for more information. As the page explains, the one caveat to using the images is that they must be consistent with their specified usage ("In other words, don't use the 'Cut' image for a 'Copy' command."), but this really just makes sense.


If you can't find the icons you're looking for included with Visual Studio's image library, there are plenty of free icon packs available on the Internet. Several of the other posts mention their picks, but I'm a huge fan of Fugue Icons. Similar to the Silk icons, they're free for use in your applications as long as you provide attribution. Otherwise, you can purchase a royalty-free license for a very reasonable price.

If you have money to spend, GlyFX sells high quality icons and graphics, many of which have a similar style as those found in Windows or other Microsoft products.

And finally, if you're just looking for a particular icon, you can use one of these free icon search engines:

Copywriter answered 10/11, 2010 at 7:56 Comment(7)
FWIW I got tripped up on Program Files vs. Program Files(x86), hope this helps someone else...Hemophilia
@Cody Gray does windows expose a static class that encapsulate the icons and could be used in xaml ?Admire
I have no such 'VS...ImageLibrary' folder. Checked in Program Files and in Program Files(x86), as well as 4+ different visual studio version install locations.Pardoes
@Pardoes Hmm yeah, the answer might be out of date it looks like. It was written when VS 2010 was the current version, and that directory is definitely there. But it may not be there on more recent versions of VS. I haven't updated my main dev box, so I can't check, but it looks like on a VM with VS 2015 that it's not there.Copywriter
Not useful, no examples of implementationPoteet
Examples of implementation of...icons? I’m sorry, @Demodave, I don’t understand your comment. Is that a joke? If you have a question about setting an icon for a control in your UI and/or for your EXE, that’s a separate question. I’ve got several other answers on those subjects, as do other users. If you still can’t find the information you need after searching, please ask a new question and be clear about exactly what examples you’re searching for.Copywriter
I found this in my VS 2010 installation, but when I unzipped it, EVERY image file is suffixed with an underscore. Meaning, I would have to rename each and every file to use them. What gives???Urinal
K
102

The library is no longer included beginning with VisualStudio 2012. You can download here though: http://www.microsoft.com/en-us/download/details.aspx?id=35825

They updated it for 2022 in early February 2022. Content is similar across releases, so you only need to download the latest release.

The 2022 release has 12.1 MB of content and ~4000 icon types (SVG/PNG/XAML). This release got rid the folder structure entirely and got rid of ~5000 variants (like save_grey and RunTest_inverse). It also renamed many icons again (such as SaveStatusBar became StatusBarSave) and dropped the _16x suffix on all icons. The icons do look cleaner across the board and have a more consistent feel than past releases.

The 2019 release has 10.3 MB of content and 4085 icon types (SVG/PNG/XAML). This release got rid of many BMP icons, as well as the size variations used for overlays when making custom icons (SM/MD). It also added some handy icons (CloseAll, Trash, AlignCenter, AlignMiddle, SkipFile, SmartFilter, Sort, StatusReady, Target, UserGroup). It changed folder name conventions (such as AddRowToAbove became AddToRowAbove, column icons such as 1x and 2Columns became verbose such as TableColumn and SecondOfFourColumns, Silverlight/Azure prefixes were removed). The Save icon folder has 33 versions which together are 19.8KB, due to removed BMP and SM/MD types.

The 2017 release has 12.5 MB of content and 4013 icon types (BMP/SVG/PNG/XAML). This release largely abandoned the Adobe Illustrator (.ai) file type. Icons are still sorted into folders for the individual icon types that contain the different formats. Some icons have various size/resolution versions in each format up to 256x256 size and 32bit pixel depth. Most icons have different flavors such as grey/inverse/thin/thingrey/small/medium. For example, the Save icon folder has 40 versions which together are 24.9KB. The absence of the archive folder, the 2010 legacy icons, and the Adobe Illustrator (.ai) icons together makes this release nice and compact again.

The 2015 release has 2.9 GB of content and 4222 icon types (AI/BMP/SVG/PNG/XAML). This release started offering multiple flavors of each icon type such as grey/inverse/thin/thingrey/small/medium. Icons are now sorted into folders for the individual icon types that contain the different formats and flavors. Some icons have various size/resolution versions in each format up to 256x256 size and 32bit pixel depth. The Adobe Illustrator (.ai) file type adds most of the bulk to this release. For example the Save icon folder has 84 versions which together are 5.84MB, and the .ai files are 5.69MB of this.

The 2013 release has 285.6 MB of content and 2793 icon types (BMP/ICO/PNG/XAML). Icons were sorted by function group, then by image type (726 action, 1494 concept, 753 objects as counter by png). It also has 788 legacy icons for VS2010 and an archive folder with 2010 and 2012 icons. This release started offering multiple flavors of each icon type.

The 2012 release has 19.4 MB of content and 2658 icon types (BMP/ICO/PNG/XAML). Icons were sorted by function group, then by image type (1093 common, 722 action, 91 annotation, 752 objects as counted by PNG type). Most icons available as 16x16 size and 32bit pixel depth.

Kalila answered 24/3, 2014 at 18:21 Comment(0)
C
71

If you're using a full edition (not Express) of Visual Studio, an image library is included for you to use freely in your applications (including commercial products!). The primary advantage of using icons from this library is that they are very similar or identical to those that are used in Windows and other Microsoft products, such as Office and Visual Studio, so your users will find them very familiar. This library includes images, icons, and animations and is installed on your computer when you install Visual Studio. For example, if you're using VS 2010, the image library is located here:

..\Program Files\Microsoft Visual Studio 10.0\Common7\VS2010ImageLibrary\1033

To use the files, you first need to extract them from the zip file.

See this entry on th Visual Studio Team Blog site for more information. As the page explains, the one caveat to using the images is that they must be consistent with their specified usage ("In other words, don't use the 'Cut' image for a 'Copy' command."), but this really just makes sense.


If you can't find the icons you're looking for included with Visual Studio's image library, there are plenty of free icon packs available on the Internet. Several of the other posts mention their picks, but I'm a huge fan of Fugue Icons. Similar to the Silk icons, they're free for use in your applications as long as you provide attribution. Otherwise, you can purchase a royalty-free license for a very reasonable price.

If you have money to spend, GlyFX sells high quality icons and graphics, many of which have a similar style as those found in Windows or other Microsoft products.

And finally, if you're just looking for a particular icon, you can use one of these free icon search engines:

Copywriter answered 10/11, 2010 at 7:56 Comment(7)
FWIW I got tripped up on Program Files vs. Program Files(x86), hope this helps someone else...Hemophilia
@Cody Gray does windows expose a static class that encapsulate the icons and could be used in xaml ?Admire
I have no such 'VS...ImageLibrary' folder. Checked in Program Files and in Program Files(x86), as well as 4+ different visual studio version install locations.Pardoes
@Pardoes Hmm yeah, the answer might be out of date it looks like. It was written when VS 2010 was the current version, and that directory is definitely there. But it may not be there on more recent versions of VS. I haven't updated my main dev box, so I can't check, but it looks like on a VM with VS 2015 that it's not there.Copywriter
Not useful, no examples of implementationPoteet
Examples of implementation of...icons? I’m sorry, @Demodave, I don’t understand your comment. Is that a joke? If you have a question about setting an icon for a control in your UI and/or for your EXE, that’s a separate question. I’ve got several other answers on those subjects, as do other users. If you still can’t find the information you need after searching, please ask a new question and be clear about exactly what examples you’re searching for.Copywriter
I found this in my VS 2010 installation, but when I unzipped it, EVERY image file is suffixed with an underscore. Meaning, I would have to rename each and every file to use them. What gives???Urinal
L
25

I use famfamfam's Silk Icons in several applications and really like them (they're free but you have to mention you're using them in your app + of course you can donate).

alt text

Loathing answered 10/11, 2010 at 7:49 Comment(6)
The famFam ones are excellent; in addition Visual Studio includes many as wellEne
how come there's no icon for file save/load?Contain
@Louis Rhys, if you're looking for the default windows/office library, you can use the icons library that cody indicatedLoathing
@vc74 the link is downElane
@Elane Thanks. Link updated. It's been 12 years since this question was posted so there might be better alternatives today.Loathing
@vc74 ok I see. I added Fontawsome 6 to the answers for future seekers.Elane
E
9

If you have Visual Studio (not Express) then you have access to many of the windows icons:

The Visual Studio 2010 Image Library contains application images that appear in Microsoft Windows, the Office system, Microsoft Visual Studio, and other Microsoft software. You can use this set of over 1,000 images to create applications that look visually consistent with Microsoft software.

This file is typically installed in ..\Program Files\Microsoft Visual Studio 10.0\Common7\VS2010ImageLibrary\1033.

Ref.: Visual Studio Image Library

How to: Install the Visual Studio Image Library

Licensing is talked about here: Tips and Tricks: Visual Studio 2010 Image Library

Ene answered 10/11, 2010 at 7:51 Comment(1)
If the image library is not installed with Visual Studio, you can download it here (2012): microsoft.com/en-us/download/details.aspx?id=35825Clergyman
C
3

AFAIK there isn't a collection of pre-built icons - but there a millions of high quality icons available on the web if you just search for them.

Once you have an icon (.ico) file, you can add it to your project resources. Just open the Resources.resx file, and at the top switch it to view Icons, and then "Add existing file..."

Then, to set the application icon, get Properties on your Project and in the Application tab (at the bottom) choose the icon in the drop-down box.

For any Form, set this.Icon = Resources.IconName; to use it as the Form's icon.

Chalcocite answered 10/11, 2010 at 7:47 Comment(0)
B
2

In addition to the great recommendations, you could use the glyphIcons Set, which is well suited for the currently popular Flat and puristic Designs. Include them in in your *.resx, and load them (presuming you are using C#):

System.ComponentModel.ComponentResourceManager resources = 
    new System.ComponentModel.ComponentResourceManager(typeof(MyForm));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("statusnormalorsmthg.Icon")));

or, by directly reading the Resources:

this.Icon = new Icon("Resources/statusnormalorsmthg.ico");
Bootee answered 11/9, 2013 at 9:0 Comment(0)
J
2

Use the metro package ... it has various icons that suit for almost every thing ... it's free and you can color it and control it in any way you want ... https://github.com/MahApps/MahApps.Metro.IconPacks

Jennifer answered 6/3, 2019 at 14:33 Comment(0)
E
1

I could not find the image library on my machine. I don't think it's include with the install.

I did find a link to download all the collections:

https://www.microsoft.com/en-us/download/details.aspx?id=35825

Example answered 8/2, 2019 at 15:39 Comment(0)
C
0

No. The icons of the message boxes are part of Windows. .NET itself does not provide icons or images.

Collette answered 10/11, 2010 at 7:46 Comment(0)
B
0

Use an ImageList control to store your icons or Managed Resources file.

Balaklava answered 10/11, 2010 at 7:47 Comment(1)
I'm sure the OP is looking for sets of icons and not asking about which collection to store them in.Shepp
E
0

I ended up choosing https://github.com/MartinTopfstedt/FontAwesome6.

The claim of the package:

WPF (.Net and .Net Core), UWP and WinUI controls for the web's most popular icon set and toolkit.

Just run (https://www.nuget.org/packages/FontAwesome6.Svg):

Install-Package FontAwesome6.Svg

Add to your xaml namespaces:

xmlns:fa="http://schemas.fontawesome.com/icons/svg"

Example for loading animation:

<fa:ImageAwesome Icon="Solid_Spinner" Spin="True" Height="25" Width="25" PrimaryColor="White" />

It supports net6.0 and therefore does not show an exclamation mark in the package references like many other packages.

Notice that there is a pending Issue for MAUI: https://github.com/MartinTopfstedt/FontAwesome6/issues/28

Elane answered 14/5, 2023 at 20:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.