Uncas.Core by Ole Lynge Soerensen

<PackageReference Include="Uncas.Core" Version="1.1.0.154" />

 ScreenCapture

public class ScreenCapture : IScreenCapture
Provides functions to capture the entire screen, or a particular window, and save it to a file.
public ScreenCapture()

Captures the foreground window.

Creates an Image object containing a screen shot of the entire desktop.

public void CaptureScreenToFile(string fileName, ImageFormat format)

Captures a screen shot of the entire desktop, and saves it to a file.

public Image CaptureWindow(IntPtr handle)

Creates an Image object containing a screen shot of a specific window.

public void CaptureWindowToFile(IntPtr handle, string fileName, ImageFormat format)

Captures a screen shot of a specific window, and saves it to a file.