private void pictureBox_Click(object sender, EventArgs e) { if (((PictureBox)sender).Image == null) { MessageBox.Show("無法開啟影像"); return; } Bitmap imageSource = new Bitmap(((PictureBox)sender).Image); Form form = new FormShowImage(imageSource); form.Show(); }
private void pictureBox1_Click(object sender, EventArgs e) { Form action = new FormShowImage(new Bitmap(pictureBox1.Image)); action.Show(); }