Simple screenshot library for .NET Framework. Allows selection and capture of screen region, similar to Snipping Tool.
- .NET 4.6.2+
PM> Install-Package GI.Screenshot
// allow user to select and capture screen region
var image = Screenshot.CaptureRegion();
// get a screenshot of given region
var image = Screenshot.CaptureRegion(rect);
// get a screenshot of all screens
var image = Screenshot.CaptureAllScreens();
The application must enable per-monitor DPI awareness in order for the region selection to work properly on a multi-monitor setup where not all monitors use the same scale factor.
It is recommended that to be set in the application manifest:
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>