public void updateInfo(Bitmap frame) { if (frame != null) { frame = Handdetection.imageBinarization(frame, setup.Threshold, setup.Mirror); frame = Handdetection.Findhands(frame, setup.Rectangles); Graphics g = Graphics.FromImage(frame); Brush b = new SolidBrush(Color.FromArgb(64, 0, 191, 255)); foreach (Rectangle r in setup.Rectangles) { g.FillRectangle(b, r); } pictureBoxHandDetection.Image = (Image)frame; } Update(); }
private void updatePictureBox(Object sender, NewFrameEventArgs e) { Bitmap bmp = (Bitmap)e.Frame.Clone(); if (bmp != null) { bmp = Handdetection.imageBinarization(bmp, setup.Threshold, setup.Mirror); pictureBoxHanddetectionZones.Image = Handdetection.Findhands(bmp, setup.Rectangles); bmp = GetNonIndexed(bmp); Graphics g = Graphics.FromImage(bmp); System.Drawing.Brush b = new SolidBrush(System.Drawing.Color.FromArgb(150, 255, 0, 0)); foreach (System.Drawing.Rectangle r in setup.Rectangles) { g.FillRectangle(b, r); } pictureBoxHandzones.Image = bmp; } }