void btnCaptureImage_Click(object sender, EventArgs e) { var frmCap = new frmCaptureImage(); frmCap.ShowDialog(); //if (frmCap.ShowDialog() != DialogResult.OK) //{ // return; //} // Render the Image on Picture Box //var bmp = new Bitmap(pictureBox1.Image); //Graphics gr = Graphics.FromImage(bmp); //Pen p = new Pen(Color.Red); //p.Width = 5.0f; //gr.DrawRectangle(p, 1, 2, 30, 40); //pictureBox1.Image = bmp; picImage.Image = new Bitmap(Utils.CaptureImage); picImage.Update(); //frmCap.RenderImageAction += RenderImageAction; //frmCap.Close(); }
void picCapture_Click(object sender, EventArgs e) { var frmCap = new frmCaptureImage(); frmCap.ShowDialog(); if (Utils.CaptureImage != null) { picImage.Image = new Bitmap(Utils.CaptureImage); picImage.SizeMode = PictureBoxSizeMode.StretchImage; } }