Screen capture video source.

Namespace:  AForge.Video
Assembly:  AForge.Video (in AForge.Video.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public class ScreenCaptureStream : IVideoSource

Remarks

The video source constantly captures the desktop screen.

Sample usage:

CopyC#
// get entire desktop area size
Rectangle screenArea = Rectangle.Empty;
foreach ( System.Windows.Forms.Screen screen in 
          System.Windows.Forms.Screen.AllScreens )
{
    screenArea = Rectangle.Union( screenArea, screen.Bounds );
}

// create screen capture video source
ScreenCaptureStream stream = new ScreenCaptureStream( screenArea );

// set NewFrame event handler
stream.NewFrame += new NewFrameEventHandler( video_NewFrame );

// start the video source
stream.Start( );

// ...
// signal to stop
stream.SignalToStop( );
// ...

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

Inheritance Hierarchy

System..::.Object
  AForge.Video..::.ScreenCaptureStream

See Also