public void setImage2(Image <Gray, byte> dest) { SetPicture sl = new SetPicture(delegate(Image <Gray, byte> d) { imageBox2.Image = d; }); textBox1.Invoke(sl, dest); }
public void setImage1(Image <Gray, byte> dest) { SetPicture sl = new SetPicture(delegate(Image <Gray, byte> d) { imageBox1.Image = d; //清空结果框 imageBox2.Image = null; textBox2.Text = ""; label1.Text = ""; }); textBox1.Invoke(sl, dest); }
private void SetIma(Image image) { if (mainPanel.InvokeRequired) { SetPicture a = new SetPicture(SetIma); Invoke(a, new object[] { image }); } else { PictureBox pictureBox = new PictureBox(); pictureBox.Width = 1200; pictureBox.Height = (int)((double)1200 / image.Size.Width * image.Size.Height); pictureBox.Image = (Image)(new Bitmap(image, pictureBox.Size)); pictureBox.Location = new Point(0, pos); pos += pictureBox.Height + 30; pictureBox.Parent = mainPanel; mainPanel.Controls.Add(pictureBox); } }