Introduction
There is a tremendous job done by NET master and enhanced by Brian Low. However, I
was needed a library that can continuously capture image/bitmap from the video
source and record it at the same time. Then I saw the Net master's project and
Brian low's project. Well, they have done a great job, but the feature was not
included in the project. So I decided to add one. By the way, I saw another
project that did the same function, but it was not continuously capturing the
frame by triggering event, and the video capture is rather slow, it cannot
produce a smooth stream. And the frame per second is rather slow too. However,
it was a great effort.
Background
Actually I was just combining the samples together. So, it could be best for you all
to refer back to the samples.
Using the code
Just add a button for triggering the event and the GrapImg
method.
Then, add another handler of the event, which I add is the CaptureDone
handler.
The
CaptureDone
will be fired once a frame was copied from the image
buffer. After that, just display the bitmap into a picture box.
private void button1_Click(object sender, System.EventArgs e)
{
capture.FrameEvent2 += new Capture.HeFrame(CaptureDone);
capture.GrapImg();
}
private void CaptureDone(System.Drawing.Bitmap e)
{
this.pictureBox.Image=e;
}
However, for it to work, you will have to know how to use the DirectX capture
library at first. because you will have to setup the properties for a video
capture to be started, and you will need to start previewing the video before
the CaptureDone
will be fired.
Points of Interest
Well, one thing is, it took me a lot of time reading through NET master's and Brian
Low's code. Any comment, you are welcome..... thanks. Below are two links to
the Brian Low's class library and NET Master's DirectShow.NET. (Thanks for the
suggestion)
History
None.