How to draw video on PictureBox
To draw a video on PictureBox, you need to add control to the form. Set BackColor property to Black and SizeMode property to StretchImage.
Add a bool class member called applyingPictureBoxImage on Start button code set applyingPictureBoxImage to false before starting capture or playback.
Implement the OnVideoFrameBitmap event to draw the frame.
private void VideoCapture1_OnVideoFrameBitmap(object sender, VideoFrameBitmapEventArgs e)
applyingPictureBoxImage = true;
var image = pictureBox1.Image;
pictureBox1.Image = new Bitmap(e.Frame);
applyingPictureBoxImage = false;
- Add PictureBox clearing to the Stop button code. Code should be called after SDK control Stop method call.
pictureBox1.Image = null;
- SDK redist
Visit our GitHub page to get more code samples.