I'm trying to draw on my screen with c# but it only seems to draw e few pixels. Also when I log
Console.WriteLine(Screen.PrimaryScreen.Bounds.Width);
Console.WriteLine(Screen.PrimaryScreen.Bounds.Height);
It loggs: 1620, 1080 which is half my screen size...
Here is my code with which I'm trying to draw:
[DllImport("User32.dll")]
public static extern IntPtr GetDC(IntPtr hwnd);
[DllImport("User32.dll")]
public static extern void ReleaseDC(IntPtr hwnd, IntPtr dc);
static void Main(string[] args) {
Console.WriteLine(Screen.PrimaryScreen.Bounds.Width);
Console.WriteLine(Screen.PrimaryScreen.Bounds.Height);
IntPtr desktopPtr = GetDC(IntPtr.Zero);
Graphics g = Graphics.FromHdc(desktopPtr);
SolidBrush b = new SolidBrush(Color.White);
g.FillRectangle(b, new Rectangle(0, 0, 16000, 16000));
}
Hope someone can help me, Elias :)