using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace pictureview
{
public partial class frmViewer : Form
{
public frmViewer()
{
InitializeComponent();
}
// Show the open file dialog box.
private void btnSelectPicture_Click(object sender, EventArgs e)
{
// Show the open file dialog box.
if (ofdSelectPicture.ShowDialog() == DialogResult.OK)
{
// Load the picture into the picture box.
picShowPicture.Image = Image.FromFile(ofdSelectPicture.FileName);
// Show the name of the file in the form's caption.
this.Text = string.Concat("Picture Viewer(" + ofdSelectPicture.FileName + ")");
}
}
private void btnQuit_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
需要兩個Button,一個Picture Box,一個OpenFileDialog
- Mar 15 Sun 2015 10:45
Visual C#開發的圖片觀賞工具(附程式碼)
全站熱搜
留言列表