c# - WPF: Multiple screens -


i'm writing screensaver in wpf. have screensaver working, however, displays on main monitor. there way "black out" or draw graphics additional monitors when user has multiple displays? i've done searching around, haven't found relevant.

update

from ananthonline's answer below, able accomplish "black out" effect on non-primary displays using 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 initializing 1 each screen in app.xaml.cs using 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 import system.windows.forms required access screen class.

you should able use system.drawing.screen.* classes set multiple windows on each screen. mind don't set each window maximized, sized, border less window.

also - might want remember total bounds of multi monitor setup may not rectangle (if plan "union" bounds create window spanning monitors).


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -