How To Create an Icon for Visual Studio with just MSPaint and Visual Studio
Asked Answered
K

2

37

I have been reading a lot of posts about creating icons and then assigning one of those icons in Visual Studio Project --> Properties --> Icon and Manifest. When I do this, I get a message that the icon is not valid. The primary way I have been doing this is using MSPaint.

This is when I save a 24-bit icon in MSPaint, which is mentioned in one of the posts I read. I cannot find any editing ability in the image editor of Visual Studio 2012. So, how does one create a simple icon for an application?

I know there are free converters out there. I am asking specifically if there is a way to convert using existing tools like Visual Studio, MSPaint, and so on.

Knavish answered 2/12, 2016 at 13:26 Comment(7)
You need to convert it to .ico format.Jodee
Yes @JohnnyMopp , but what converts to .ico, 'cause saving it as .ico does not work, despite what the article said.Knavish
MSPaint does not support creating icons. Many icon editors around, but consider the one you have in front of you. Project > Add New Icon > Icon File. Use copy/paste to put a bitmap in the icon.Gunner
@HansPassant Suggest that be the answer then. Thank you.Knavish
Erm, I did suggest it as a possible answer. You can complete the Q+A you started with this hint if you like doing it this way, mark your post as the answer and flag the comment as "Obsolete".Gunner
@HansPassant Don't know how to mark my post as the answer, other than writing your comment in as a separate answer.Knavish
I tried copy/pasting from Photshop to VS, from Paint to VS, from VS to VS, after drag and drop ... No way it will paste into my ico ...Agony
U
15

When this question was posted in 2016, it made more sense to use only MSPaint and VS. But nowadays, you can just use https://icoconverter.com/

  1. Upload your image file (PNG, GIF, JPG, etc.)
  2. Select the desired resolutions.
  3. Download the ICO file, which contains various resolutions of your original image.
Unborn answered 2/10, 2020 at 13:35 Comment(5)
Though this works , how come this is accepted answer?...because question was asked using VS and Paint only.... so answer by @Ola Ström should be the accepted answerWaggle
@Waggle Valid point. But I think it makes sense in this case because the question was asked a long time ago. Since then, simpler alternatives have appeared. By marking this as the answer, you point most readers to the simpler solution. Or at least make them aware of it.Unborn
It worked with this site: icoconverter.comAxis
It does not work for me, regardless of the input file. It's not a universal solution and apparently there's lack of documentation for what is actually required by the VS Installer.Rift
that link no longer has an option for 'select ico for windows 7...'Revolve
I
57

Note: For other methods, check out this post: Best way to create an application icon


Creating an icon in MSPaint works just fine. Here's how you should proceed to get it to work.

In Visual Studio

  • Open Resources.resx from Solution Explorer (it's in the Properties folder)

  • Choose Icons from DropDown Menu on the left [Ctrl+3]

  • Choose Add New Icon from the DropDown Menu Add Resource

  • Enter a name for the Icon Resource file

  • Right click on all the icons in the left panel - one at a time - and choose Delete Image Type (The last icon cannot be deleted - Leave it for now)

enter image description here

In MSPaint or an image program of your choise (I prefer Microsoft Paint 3D)

  • Create/Open the image that you would like to use (It could be a screenshot of your program)

  • Resize the image to 256x256 pixels

  • Select the full image [Ctrl+A] and then copy the image [Ctrl+C]

In Visual Studio

  • Right click in the left panel (the icon panel) and choose New Image Type... [Ins]

  • Choose Target Image Type 256x256, 24 bit

  • (Select the New Target Type and) Paste [Ctrl+V] the image you copied from your image program

In your image program and in Visual Studio

  • Repeat the above Image Copy (image program) and Target Paste (Visual Studio) process for the 24 bit icon size's 128x128, 64x64, 32x32 and 16x16 (and/or the ones you like to support)

  • Don't forget to delete the last icon you couldn't delete before

enter image description here

In Visual Studio

  • Save the icon file (.ico) (by closing its tab or using [Ctrl+S])

  • Add the icon to your forms

  • Right click your project file in the Solution Explorer and choose Properties
    (You'll also find it in the Visual Studio Menu Debug -> "Your Project Name" Properties...)

  • Choose the Application section

  • Under Resources - Icon and manifest browse to and select the icon file you just created.

All set...

(Tested with Visual Studio 2017 & Visual Studio Enterprise 2019)

Ikeda answered 13/1, 2019 at 22:53 Comment(6)
This step seems unclear to me: "Right click on all the icons in the left panel - one at a time - and choose [Delete Image Type]"Lactic
Maxter: What is unclear? When you created a new icon resource file in the prevoius step, a lot of default icon of different sizes and format was also created and are accessible from the panel on the left, e.g. "256x256, 32 bit, PNG" and "48x48, 8-bit, BMP", etc. You should delete them all and create your own...Antigone
I don't see any left panel nor a lot of default icon of different size. When i double click "Ressource.resx", the file takes the whole screen space (not just a left panel). When I got in the icon tab there is only one picture of my icon (there is no choice for different resolution). And if I right click on it there is no option "[Delete Image Type]"Lactic
Did you do the 3rd step? Choose [Add New Icon] from the DropDown Menu [Add Resource]Antigone
Yes. When i click [Add New Icon] it adds an Icon to the list and then open the icon in Paint. Anyway I figured a way to do my icons, but it seems that Visual Studio 2017 doesn't work exactly the same for all of us. Thank you for your help.Lactic
I'm creating a WPF app in Visual Studio 2019 and I found I can right-click a folder in my project and just add an Icon File item to my project and then proceed with step 5 (deleting the unwanted images).Ehlers
U
15

When this question was posted in 2016, it made more sense to use only MSPaint and VS. But nowadays, you can just use https://icoconverter.com/

  1. Upload your image file (PNG, GIF, JPG, etc.)
  2. Select the desired resolutions.
  3. Download the ICO file, which contains various resolutions of your original image.
Unborn answered 2/10, 2020 at 13:35 Comment(5)
Though this works , how come this is accepted answer?...because question was asked using VS and Paint only.... so answer by @Ola Ström should be the accepted answerWaggle
@Waggle Valid point. But I think it makes sense in this case because the question was asked a long time ago. Since then, simpler alternatives have appeared. By marking this as the answer, you point most readers to the simpler solution. Or at least make them aware of it.Unborn
It worked with this site: icoconverter.comAxis
It does not work for me, regardless of the input file. It's not a universal solution and apparently there's lack of documentation for what is actually required by the VS Installer.Rift
that link no longer has an option for 'select ico for windows 7...'Revolve

© 2022 - 2024 — McMap. All rights reserved.