Expression.Encoder를 사용하여 Logitech 웹캠과 C# 코드 인터페이스를 작성했습니다. 이 코드는 설정하기가 매우 쉬웠고 내 컴퓨터와 테스터기에서 아름답게 작동합니다. 안타깝게도 카메라의 미리보기 화면에는 검은 색 화면이 표시됩니다. Logitech의 앱과 MS의 Expression 응용 프로그램 모두에서 카메라가 피드를 표시한다는 것을 확인했습니다. Windows Media Player 및 DirectX 11이 설치됩니다. 문제는 누군가가 작동하지 않는 미리보기 창 만들기에있는 것 같습니다.Expression.Encoder 및 웹캠에서 작동하는 검정 미리보기 화면
// create the camera feed with just a video
currentJob = new LiveJob();
currentDeviceSource = currentJob.AddDeviceSource(currentVideoDevice, null);
System.Drawing.Size size = new System.Drawing.Size(250, 275);
currentDeviceSource.PickBestVideoFormat(size, (long)15);
SourceProperties sp = currentDeviceSource.SourcePropertiesSnapshot();
pnlCameraPreview.Size = new System.Drawing.Size(sp.Size.Width, sp.Size.Height);
currentJob.OutputFormat.VideoProfile.Size = new System.Drawing.Size(sp.Size.Width, sp.Size.Height);
// attach to the preview panel
currentDeviceSource.PreviewWindow = new PreviewWindow(new HandleRef(pnlCameraPreview, hwndPreviewPanel));
currentJob.ActivateSource(currentDeviceSource);
질문 (pnlCameraPreview)의 패널은 WPF의 내부 호스팅 윈도우 폼 패널입니다. 왜 이것이 작동하지 않는지에 대한 생각은 인정 될 것입니다!