Added an icon to a Windows Forms application

Introduction

It was difficult to create an icon with the bitmap editor that comes with Visual Studio, so I tried to summarize how to create an icon using Microsoft Paint.

Note 1

You cannot edit 32-bit icons and PNGs with the image editor provided as standard in visual studio. A separate paint tool is required.

Note 2

The file format of ico files is different from that of bmp that can be displayed using the windows system compatibility function. Use an app such as @icon Converter to convert to ICO file format. If the format is not changed correctly, a warning will be displayed when adding an icon. x15.png

File formats that can be used for icons

size Number of colors file format
256 x 256 32bit PNG
48 x 48 8bit BMP
32 x 32 8bit BMP
16 x 16 8bit BMP
256 x 256 32bit PNG
64 x 64 32bit BMP
48 x 48 32bit BMP
32 x 32 32bit BMP
16 x 16 32bit BMP

Icon registration procedure

  1. Create a bmp file with a paint tool such as mspaint. Format conversion with @icon etc.

  2. Create (or open) the project to which you want to add an icon in visual studio.

  3. Open the project properties. 1.png

  4. Click the [Browse] button on the icon.

  5. Select the ico file from Windows Explorer. 2.png

  6. Confirm that the icon is loaded. 4.png

  7. When you build the project (or build with debugging), you can see that ico is embedded in the executable file.

5.png

reference

--Visual Studio Operation How to make an icon via Lonely computer http://ulalablog.jugem.jp/?eid=106

The app used for icon conversion

-@Icon conversion https://www.vector.co.jp/soft/win95/amuse/se201729.html

Recommended Posts