2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Windowsフォームアプリケーションにアイコンを追加した

Last updated at Posted at 2020-08-13

はじめに

Visual Studioに付属するビットマップエディターでアイコンを作るのが大変だったのでMicrosoft Paintを使ってアイコンを作るやり方をまとめてみた。

注意1

visual studioに標準で用意されているイメージエディタでは32bitアイコンやPNGを編集することができない。別途ペイントツールが必要。

注意2

icoファイルはwindowsシステム互換機能を用いて表示できるbmpとはファイルフォーマットが異なります。@icon変換などのアプリを使って、ICOファイルフォーマットに変換しましょう。
もし、正しくフォーマット変更できていないとアイコン追加の時に警告が表示されます。
x15.png

アイコンに使えるファイル形式

サイズ 色数 ファイル形式
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

アイコン登録手順

1.mspaintなどのペイントツールでbmpファイルを作成。@iconなどでフォーマット変換する。

2.visualstudioにてiconを追加したいプロジェックトを作成(もしくは開く)。

3.プロジェクトのプロパティを開く。
1.png

4.アイコンの[参照]ボタンをクリック。

5.Windowsエクスプローラーからicoファイルを選択。
2.png

6.アイコンが読み込まれたことを確認。
4.png

7.プロジェクトをビルドする(もしくはデバッグ込みビルド)と、実行ファイルにicoが埋め込まれていることが確認できる。

5.png

参考

icon変換に使用したアプリ

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?