Created
February 15, 2018 07:00
-
-
Save mrgarita/0916a96a443d002458451d87331ee3f3 to your computer and use it in GitHub Desktop.
C#:リソースに設定した画像を表示する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Windows.Forms; | |
namespace リソースに設定した画像を表示する | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
private void Form1_Load(object sender, EventArgs e) | |
{ | |
this.Text = ProductName; | |
// ピクチャボックスの設定 | |
pictureBox1.Dock = DockStyle.Fill; // フォームいっぱいに貼り付ける | |
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; // 縦横比を変えずに引き延ばす | |
// ピクチャボックスにリソース画像を設定 | |
pictureBox1.Image = Properties.Resources.kero; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment