AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

Capture Image from Webcam without Preview/Buttonclick

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

Capture Image from Webcam without Preview/Buttonclick

Postby noisiv » Wed Jun 15, 2016 12:27 pm

Hello,

i´ve the source from snapshotMaker and can compile it 1:1 :)
but i like to remove all "user activities" like, preview window and buttonclicks..

what i only need is an application, that capture an image (with predefined resolution) an save as png/bmp/jpg... what ever...

i´ve found the examplecode here -->

Code: Select all
// enumerate video devices
videoDevices = new FilterInfoCollection( FilterCategory.VideoInputDevice );
// create video source
VideoCaptureDevice videoSource = new VideoCaptureDevice( videoDevices[0].MonikerString );
// set NewFrame event handler
videoSource.NewFrame += new NewFrameEventHandler( video_NewFrame );
// start the video source
videoSource.Start( );
// ...
// signal to stop when you no longer need capturing
videoSource.SignalToStop( );
// ...

private void video_NewFrame( object sender, NewFrameEventArgs eventArgs )
{
    // get new frame
    Bitmap bitmap = eventArgs.Frame;
    // process the frame

---->> Write bitmap to file ?! <<-----    like Bitmap.Save()

}


can anyone help me, to get this running ?

thank you

noisiv
noisiv
 
Posts: 1
Joined: Wed Jun 15, 2016 12:06 pm



Return to AForge.NET Framework