Basically getting an exception error and Im stumbled, I have tried googling but have not found anything and it's really frustrating me now.
public static Graphics graphics;
[STAThread]
static void Main(string[] args)
{
GetWindowRect(handle, out rect);
rect.width = rect.left - rect.right;
rect.height = rect.bottom - rect.top;
window = new OverlayWindow(rect.left, rect.top, rect.width, rect.height)
{
IsTopmost = true,
IsVisible = true
};
graphics = new Graphics()
{
MeasureFPS = true,
PerPrimitiveAntiAliasing = true,
TextAntiAliasing = true,
UseMultiThreadedFactories = false,
VSync = true,
Height = window.Height,
Width = window.Width,
WindowHandle = IntPtr.Zero
};
window.CreateWindow();
graphics.WindowHandle = window.Handle;
graphics.Setup();
Thread t = new Thread(Tutorial);
t.Start();
..... ```
public static void Tutorial()
{
while (true)
{
graphics.BeginScene();
graphics.ClearScene();
graphics.DrawCrosshair(graphics.CreateSolidBrush(Color.Red), new Point(1920 / 2, 1080 / 2), 5, 2, CrosshairStyle.Plus);
graphics.EndScene();
}
} ```
Again this gives me an exception that the Height or Width isnt valid and im honestly insanely confused. I have tried googling it a lot more but cannot find anything. any help appreciated would honestly be great, many thanks!