C # projector control / display

I had a little search, but I could not find anything similar to what I was looking for. I am curious to know how to display various content on secondary / tertiary monitors or projectors using C #. Basically, I want to achieve that on one screen (main display view) the presenter view (PowerPoint point) is displayed as well as the output on the secondary screen or projector. I've never tried to develop something with multiple display outputs, so any guidance should probably be at a pretty obvious level.

If someone can point me in the right direction regarding how to handle things like this in C #, that would be very helpful!

+1


a source to share


4 answers


You can use the property System.Windows.Forms.Screen.AllScreens

to access a list of all monitors that Windows knows about. If you want to use a display that hasn't been customized by the user, it gets more complicated - you probably need to initialize and access the display adapter using DirectX.



+2


a source


Just to expand on Keven's answer (I + 1'd), the Screen.AllScreens array gives you an array of Screen objects. The Screen object has an IsPrimary property that you can use to define the primary screen, which is secondary (duh), and it also has a WorkingArea property, which is a rectangle that gives you all the coordinates of the second screen. The cool thing about this is that even though the secondary screen could be said to be set to be to the left of the primary, WorkingArea.X will be a negative number, and you can place forms there or whatever.



+3


a source


One of the main classes you will need to interact with is Screen (that's in the WinForms namespace). In general, all screens are treated as a collection of workspaces, which you can use the screen class to obtain properties for each one.

You can get all screens like this ...

Screen [] screens = Screen.AllScreens;

      

Here is a short article on Multi-Monitor Programming in C #.

+1


a source


Also remember to set the "StartPosition" property to "Manual" on the window you want to display on the secondary screen, otherwise it will always be displayed on the primary screen.

0


a source







All Articles