简体   繁体   中英

How do screensavers support multiple monitors?

If i were developing a screensaver using a windows.form in C# how would i support multiple monitors? obviously i need a way to enumerate the monitors and maybe create forms for them too or just fade to black? Has anyone solved this?

Any insight would be helpful, what's the best approach?

I would recommend this article from CodeProject it helped me create my first screen saver and talks about multiple monitor support.

System.Windows.Forms.Screen class has all the information you need about how many monitors and what the bounds of those monitors are. The property AllScreens would be a good place to start.

for (int i = Screen.AllScreens.GetLowerBound(0); i <= Screen.AllScreens.GetUpperBound(0); i++)
{
ScreensaverFormList[i].Bounds = Screen.AllScreens[i].Bounds;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM