私のアプリケーションは、2番目のモニタで使用されることもあれば、コンピュータのプライマリモニタで使用されることもあります。2番目のモニタ/ TVの下にあるメインWPFウィンドウのスクリーンショット
2番目のモニタのスクリーンショットはどのように取得できますか?
次のコードは、セカンドモニタでは動作しません... Screen.PrimaryScreen.Bounds
の
Graphics gfx;
Bitmap bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
gfx = Graphics.FromImage(bmp);
gfx.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
MemoryStream ms = new MemoryStream();
bmp.Save(ms, ImageFormat.Jpeg);
byte[] bitmapData = ms.ToArray();
私は、あなたがより適切なもので 'PrimaryScreen'を置き換える必要があると思います。 –