public static void Main()
float angle = (float)(Math.PI / 180) * 90f;
float nw = Math.Abs(w * (float)Math.Cos(angle)) + Math.Abs(h * (float)Math.Sin(angle));
float nh = Math.Abs(w * (float)Math.Sin(angle)) + Math.Abs(h * (float)Math.Cos(angle));
Console.WriteLine((int)nw + " by " + (int)nh + " at angle " + (angle / (Math.PI / 180)));
float displayHeight = nh * 1.15f;
Size size = new Size(GetNewWidth((int)nw, (int)nh, (int)displayHeight), (int)(displayHeight / ScreenResolution.Height * 720f));
public static int GetNewWidth(int oldWidth, int oldHeight, int newHeight)
float initialWidth = ((float)oldWidth / (float)oldHeight) * (float)newHeight;
float percentage = initialWidth / (float)ScreenResolution.Width;
return (int)(percentage * 1280);
public static int GetNewHeight(int oldWidth, int oldHeight, int newWidth)
float initialHeight = ((float)oldHeight / (float)oldWidth) * (float)newWidth;
float percentage = initialHeight / (float)ScreenResolution.Height;
return (int)(percentage * 720);
public static class ScreenResolution
public static int Width = 1920;
public static int Height = 1080;