Wednesday, April 13, 2011

Creating Image Viewer in C#

private void btnSelectPicture_Click(object sender, EventArgs e)
        {
            if (ofdSelectPicture.ShowDialog() == DialogResult.OK)
            {
                //load the picture into dialog box
                picShowPicture.Image = Image.FromFile(ofdSelectPicture.FileName);
                //show the name of file in form caption
                this.Text = string.Concat("Picture Viewer(" + ofdSelectPicture.FileName + ")");
            }
        }

No comments:

Post a Comment