1

少し調べてみましたが、探していたものに似たものは見つかりませんでした。C#を使用して2次/3次モニターまたはプロジェクターで異なるコンテンツを表示する方法を知りたいです。基本的に、私が達成したいのは、ある特定の画面(プライマリディスプレイ)に何らかの形のプレゼンタービュー(láPowerpoint)を表示し、セカンダリ画面またはプロジェクターに出力を表示することです。私は実際に複数のディスプレイ出力を備えたものを開発しようとしたことがないので、ガイダンスはおそらくかなり明白なレベルでなければなりません。

誰かがC#でこの種のことを処理する方法について正しい方向に私を向けることができれば、それは大いにありがたいです!

4

4 に答える 4

3

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

于 2009-05-15T00:51:42.200 に答える
2

You can use the System.Windows.Forms.Screen.AllScreens property to access a list of all the monitors Windows knows about. If you're looking to utilize a display that hasn't been configured by the user, it gets more difficult - you'd probably need to initialize and access the display adapter using DirectX.

于 2009-05-15T00:47:38.963 に答える
1

One of the main classes you will need to interact with is Screen (this is in the WinForms namespace). In general all the screens are treated as a set of working areas that you can use the screen class to get properties for each one.

You can get all the screens like this...

Screen [] screens = Screen.AllScreens;

Here is a short article about doing multi-monitor programming in C#.

于 2009-05-15T00:50:35.337 に答える
0

また、セカンダリ スクリーンに表示するウィンドウのプロパティ 'StartPosition' を 'Manual' に設定することを忘れないでください。そうしないと、常にプライマリ スクリーンに表示されます。

于 2018-12-02T13:49:01.120 に答える