[C#] Picture Viewer
C# 2007. 12. 5. 10:58 |![사용자 삽입 이미지](https://t1.daumcdn.net/tistoryfile/fs4/17_5_29_17_blog159394_attach_0_30.png?original)
2. Select Picture 버튼을 추가 한다.
3. Quit 버튼을 추가한다.
4. OpenFileDialog 파일 오픈 상자를 위한 컨트롤을 추가 한다.
소스 코드 :
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnSelectPicture_Click(object sender, EventArgs e)
{
if (ofdSelectPicture.ShowDialog() == DialogResult.OK)
{
picShowPicture.Image = Image.FromFile(ofdSelectPicture.FileName);
this.Text = string.Concat("Picture Viewer(" + ofdSelectPicture.FileName + ")");
}
}
private void btnQuit_Click(object sender, EventArgs e)
{
this.Close();
}
}