Docsity

How to upload image in visual studio using c++ full code, Study Guides, Projects, Research of Computer Programming

Toggle sidebar
bg1
->openFileDialog us to browse window and select image.
->pictureBox1 is area where picture display.
code behind button::
private void button1_Click(object sender, EventArgs e)
{
DialogResult dr = openFileDialog1.ShowDialog();//To browse file after clicking
browse button
if (dr == DialogResult.OK)//check if any image selected or not
{
pictureBox1.Image = Image.FromFile(openFileDialog1.FileName);//give image
path from selected image
}
}

Partial preview of the text

Download How to upload image in visual studio using c++ full code and more Study Guides, Projects, Research Computer Programming in PDF only on Docsity!

->openFileDialog us to browse window and select image. ->pictureBox1 is area where picture display. code behind button::

private void button1_Click(object sender, EventArgs e) { DialogResult dr = openFileDialog1.ShowDialog();//To browse file after clicking browse button if (dr == DialogResult.OK)//check if any image selected or not { pictureBox1.Image = Image.FromFile(openFileDialog1.FileName);//give image path from selected image