Multiple monitors in .NET

梦想的初衷 提交于 2019-12-04 20:49:33

问题


Are all displays returned from .NET's Screen.AllScreens regardless of hardware configuration? For example, on a single PC you can have:

  1. Video card out to two display = total 2 displays
  2. Video cards each out to 1 display = total 2 displays,
  3. Video cards each out to 2 displays = 6 displays,
  4. Eyefinity card out to 6 displays (on displayports)

In all these cases, if I use Screen.AllScreens can I access each display individually?

Also, what if I have a card in extended mode, meaning 2 displays plugged into one card but it's just one big desktop (what I use at work)? Can I still specify content to appear on one screen?


回答1:


Yes, Windows doesn't care how the screens are distributed across video adapters. It simply gives each screen its own coordinates, depending how you arrange them in the Display applet. You get your window to display on a specific one by setting its location and size to fit inside the Screen.Bounds




回答2:


Extended desktop doesn't affect the number of screens.

It should be safe to assume 1 screen per display. Though some hardware may report wrong counts of display, this is very rare. In such cases, you will notice in the control panel that you have the incorrect count anyway.




回答3:


The AllScreens property will list the same monitors that Windows shows in the control panel. For example, if you have an Eyefinity set up as a single large surface (SLS), it will appear as a single entry in the list; if you have it set up as 6 separete monitors, it will be 6 entries in the list.



来源:https://stackoverflow.com/questions/5215001/multiple-monitors-in-net

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!