Created
November 15, 2017 07:07
-
-
Save mrgarita/8ecb75f70070eb282191441993e64a1e 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 = Application.ProductName; | |
button1.Text = "Before"; | |
button2.Text = "After"; | |
} | |
private void button1_Click(object sender, EventArgs e) | |
{ | |
pictureBox1.ImageLocation = @"c:\image\before.jpg"; | |
} | |
private void button2_Click(object sender, EventArgs e) | |
{ | |
pictureBox1.ImageLocation = @"c:\image\after.jpg"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment