Menu Close
< Back
You are here:

How can I program screen capture using C#

– add a reference to the NET DLL of the package corresponding to the .NET Framework version of the .csproj project
– start from the following sample code:

public Form1()

VidGrab.VideoGrabber vg;

private void Form1_Load(object sender, EventArgs e)
   vg = new VidGrab.VideoGrabber();
   vg.Parent = this;
   vg.Location = new Point(100, 100);
   vg.VideoSource = VidGrab.TVideoSource.vs_ScreenRecording;

private void Button1_Click(object sender, EventArgs e)
   vg.CaptureFrameTo(VidGrab.TFrameCaptureDest.fc_JpegFile, “c:\\myfolder\\snapshot.jpg”);