원격 데스크톱 (RDP) 세션에서 스크린 샷을 캡처하는 데 사용하는 다음 C# 코드가 있습니다. 세션이 활성 상태 일 때 제대로 작동하지만 세션을 최소화하면 잘못된 핸들 예외로 실패합니다.최소화 된 원격 데스크톱의 스크린 샷 캡처
이 작업을 수행 할 수있는 방법이 있습니까, 아니면 세션이 최소화되었을 때 화면이 근본적으로 "없어 졌습니까?
string filename = @"C:\Snap.png";
Size bitmapSize = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
using (Bitmap bitmap = new Bitmap(bitmapSize.Width, bitmapSize.Height, PixelFormat.Format24bppRgb))
using (Graphics graphics = Graphics.FromImage(bitmap))
{
graphics.CopyFromScreen(// Exception thrown here
new Point(0, 0),
new Point(0, 0),
bitmapSize);
bitmap.Save(filename, ImageFormat.Png);
}
프로그램이 원격 시스템이나 로컬 시스템에서 실행되고 있습니까? – siride
원격 컴퓨터에서 실행 중입니다. – ngoozeff