I am trying to draw to the screen directly in C# via the Graphics
object retrieved from Graphics.FromHwnd(IntPtr.Zero)
but I am limited to the primary monitor for some reason.
Upon inspecting the Graphics
object, I found that the VisibleClipBounds
are limited to my first monitors resolution.
I have two 1920x1080 monitors, so, I guess, that property has to be 3840x1080.
Is there a way to solve my issue?
The code is really simple, I have a wrapper class that looks like this:
public class ScreenCropperDrawer
{
private static Graphics screenGraphics;
public static void FillRectangle(Brush brush, Rectangle rect)
{
if (screenGraphics == null)
{
screenGraphics = Graphics.FromHwnd(IntPtr.Zero);
}
screenGraphics.FillRectangle(brush, rect);
}
}