Beispiel #1
0
        public static WPFScreen GetScreenFrom(Window window)
        {
            var windowInteropHelper = new WindowInteropHelper(window);
            var screen    = Screen.FromHandle(windowInteropHelper.Handle);
            var wpfScreen = new WPFScreen(screen);

            return(wpfScreen);
        }
Beispiel #2
0
        public static WPFScreen GetScreenFrom(Point point)
        {
            var x = (int)Math.Round(point.X);
            var y = (int)Math.Round(point.Y);

            var drawingPoint = new System.Drawing.Point(x, y);
            var screen       = Screen.FromPoint(drawingPoint);
            var wpfScreen    = new WPFScreen(screen);

            return(wpfScreen);
        }