Generation

generate functionTue, 21 Mar 2023

从文件中打开图片并显示在picturebox里

private void button1_Click(object sender, EventArgs e) { OpenFileDialog opf = new OpenFileDialog(); opf.Filter = "JPG|*.jpg|BMP|*.bmp|PNG|*.png"; if (opf.ShowDialog() == DialogResult.OK) { pictureBox1.Image = Image.FromFile(opf.FileName); } }

Questions about programming?Chat with your personal AI assistant