WPF: multiple screens

I am writing a screensaver in WPF. My screensaver works, but it only appears on my main monitor. Is there a way to cross out or draw graphics for additional monitors when the user has multiple displays? I did a little work, but did not find anything.

UPDATE

From the ananthonline answer below, I was able to perform a black effect on non-primary displays using the following window:

<Window x:Class="ScreenSaver.BlackOut" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Cursor="None" WindowStyle="None" ResizeMode="NoResize" Background="Black"> </Window> 

and initialize one for each screen in App.xaml.cs using the following process:

 foreach (Screen s in Screen.AllScreens) { if (s != Screen.PrimaryScreen) { BlackOut blackOut = new BlackOut(); blackOut.Top = s.WorkingArea.Top; blackOut.Left = s.WorkingArea.Left; blackOut.Width = s.WorkingArea.Width; blackOut.Height = s.WorkingArea.Height; blackOut.Show(); } } 

Note that access to the Screen class requires importing into System.Windows.Forms .

+7
c # wpf screensaver
source share
1 answer

You should be able to use the System.Drawing.Screen classes. * To configure multiple windows on each screen. Keep in mind that you are not setting the maximum number of windows, but a window with a smaller size.

Also - you may want to remember that the common border of multi-monitor settings may not always be a rectangle (if you plan to โ€œmergeโ€ all borders to create a window that covers all monitors).

+3
source share

All Articles