示例#1
0
        public static WpfScreen GetScreenFrom(Window window)
        {
            WindowInteropHelper windowInteropHelper = new WindowInteropHelper(window);

            System.Windows.Forms.Screen screen = System.Windows.Forms.Screen.FromHandle(windowInteropHelper.Handle);
            WpfScreen wpfScreen = new WpfScreen(-1, screen);

            return(wpfScreen);
        }
示例#2
0
        public static WpfScreen GetScreenFrom(int x, int y)
        {
            //int x = (int)Math.Round(X);
            //int y = (int)Math.Round(Y);

            // are x,y device-independent-pixels ??
            System.Drawing.Point        drawingPoint = new System.Drawing.Point(x, y);
            System.Windows.Forms.Screen screen       = System.Windows.Forms.Screen.FromPoint(drawingPoint);
            WpfScreen wpfScreen = new WpfScreen(-1, screen);

            return(wpfScreen);
        }