using System; using System.Drawing; using BinaryFortress.Windows; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // Assuming you are using Monitor 1, change this number if you want to target a different monitor. int monitorId = 1; // Get the current rotation of the monitor DisplayRotation currentRotation = BFS.Display.GetMonitorRotation(monitorId); // Determine the new rotation based on the current rotation DisplayRotation newRotation; if (currentRotation == DisplayRotation.Rotate0 || currentRotation == DisplayRotation.Rotate180) { // If the current rotation is landscape, change to portrait newRotation = DisplayRotation.Rotate90; } else { // If the current rotation is portrait, change to landscape newRotation = DisplayRotation.Rotate0; } // Set the new rotation BFS.Display.SetMonitorRotation(monitorId, newRotation); } }