Skip to main content

Screen capture

Products: Video Capture SDK .Net

Sample code

You can download a sample project from GitHub

You can record both the entire screen and a specific area of it.

1. Create parameters class object and set the screen as a source

ScreenCaptureSourceSettings settings = new ScreenCaptureSourceSettings(); 
settings.Mode = ScreenCaptureMode.Screen;

2. Set area coordinates

settings.FullScreen = false;

settings.Top = 0;
settings.Bottom = 1080;
settings.Left = 0;
settings.Right = 1920;

or record the entire screen:

settings.FullScreen = true;

3. Set frame rate

settings.FrameRate = 25;

4. Capture the mouse cursor

settings.GrabMouseCursor = true;

5. Apply screen capture settings

VideoCapture1.Screen_Capture_Source = screenSource;

6. Set preview mode

VideoCapture1.Mode = VideoCaptureMode.ScreenPreview;

or set capture mode, set default MP4 output settings

VideoCapture1.Mode = VideoCaptureMode.ScreenCapture;
VideoCapture1.Output_Format = new MP4Output();
VideoCapture1.Output_Filename = edOutput.Text;

7. Start

await VideoCapture1.StartAsync();

Required redists

How to install the required redists or deploy them to the user's PC?

Visit our GitHub page to get more code samples.