Пример #1
0
        private void CreateMagnifier()
        {
            if (!this.isInitialized)
            {
                return;
            }

            IntPtr hInst = Kernel32.GetModuleHandle(null);

            this.form.AllowTransparency = true;
            this.form.TransparencyKey   = Color.Empty;
            this.form.Opacity           = 0;
            User32.GetClientRect(this.form.Handle, ref this.magnificatorWindowRect);
            this.hwndMagnificator = User32.CreateWindow(
                0,
                Magnification.WC_MAGNIFIER,
                "MagnifierWindow",
                (int)WinUser.WS_VISIBLE | (int)WinUser.WS_CHILD | (int)Magnification.MagnifierStyle.MS_SHOWMAGNIFIEDCURSOR,
                this.magnificatorWindowRect.left,
                this.magnificatorWindowRect.top,
                this.magnificatorWindowRect.right,
                this.magnificatorWindowRect.bottom,
                this.form.Handle,
                IntPtr.Zero,
                hInst,
                IntPtr.Zero
                );

            if (this.hwndMagnificator == IntPtr.Zero)
            {
                return;
            }

            Magnification.Transformation matrix = new Magnification.Transformation(this.magnificationFactor);

            Magnification.MagSetWindowTransform(this.hwndMagnificator, ref matrix);
        }
Пример #2
0
 public static extern bool MagSetWindowTransform(IntPtr hwnd, ref Magnification.Transformation pTransform);