How to determine the screen size with .NET Core? I want to take a screenshot as described in DotNetCore Capture A Screenshot in Windows but they use a fixed 1920*1080 resolution which does not work for my purposes.
Do I have to reference System.Windows.Forms and thereby being nailed down to Windows?
Before switching to .NET Core we used System.Windows.Forms like so:
new Size
{
Width = Screen.AllScreens.Sum(s => s.Bounds.Width),
Height = Screen.AllScreens.Max(s => s.Bounds.Height)
}
Which is something we could use again, but we would love something platform-independent of course.