Beispiel #1
0
        public static void GetMapInformation(Utilities.WinControl.RECT minimapRect, ref Utilities.WinControl.RECT mapRect, ref float ratioWidth, ref float ratioHeight)
        {
            float MapWidth  = ((float)MapPlayableWidth);
            float MapHeight = ((float)MapPlayableHeight);
            float MapRatio  = RatioPlayable;

            if (MapWidth == 0 || MapHeight == 0 || MapRatio == float.NaN)
            {
                MapWidth  = 1;
                MapHeight = 1;
                MapRatio  = 1;
            }

            int   width       = minimapRect.Width;
            int   height      = minimapRect.Height;
            float aspectRatio = ((float)height) / ((float)width);
            float num3        = width * MapRatio;
            float num4        = ((float)height) / MapRatio;
            int   num5        = 0;
            int   num6        = 0;

            if (num3 <= height)
            {
                num4 = width;
                num5 = (int)((height - num3) / 2f);
            }
            else
            {
                num3 = height;
                num6 = (width - ((int)num4)) / 2;
            }

            ratioWidth  = num4 / MapWidth;
            ratioHeight = num3 / MapHeight;
            mapRect     = new Utilities.WinControl.RECT(minimapRect.Left + num6, minimapRect.Top + num5, (minimapRect.Left + num6) + ((int)num4), (minimapRect.Top + num5) + ((int)num3));
        }
Beispiel #2
0
 public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
Beispiel #3
0
 public static extern bool GetClientRect(IntPtr hWnd, out RECT lpRect);
Beispiel #4
0
 public static Point CenterWindow(RECT rect1, RECT rect2)
 {
     int x = rect1.Left + rect1.Width / 2 - rect2.Width / 2;
     int y = rect1.Top + rect1.Height / 2 - rect2.Height / 2;
     return new Point(x, y);
 }
Beispiel #5
0
 public static extern int GetWindowRect(
     IntPtr hWnd,
     ref RECT lpRect);
Beispiel #6
0
 public static extern bool GetClipCursor(out Utilities.WinControl.RECT lpRect);
Beispiel #7
0
 public static extern bool ClipCursor(ref Utilities.WinControl.RECT lpRect);