사용자가 자신의 입장에서 여권을 가져갈 때 WPF의 IMAGE 컨트롤에 WEBCAM 출력을 표시하려고합니다. DirectShow 라이브러리를 사용하고 있는데 이미지를 캡처하여 이미지 컨트롤에 배치 할 수 있지만 이미지를 캡처 할 때까지는 이미지 컨트롤이 비어 있습니다. 사용자가 자신의 이미지를 캡처하기 전에 이미지 컨트롤에 웹캠 출력이 표시되도록하려면 어떻게해야합니까? 감사합니다directShow를 사용하여 WPF ImageControl 내부의 웹캠에서 출력을 호스트하는 방법
이 난 내가 내 문제에서 오는 생각 라인을 댓글을 달았
private void ConfigVideoWindow(System.Windows.Controls.Image hControl)
{
HwndSource source = (HwndSource)HwndSource.FromVisual(hControl);
int hr;
IVideoWindow ivw = m_FilterGraph as IVideoWindow;
// Set the parent
hr = ivw.put_Owner(source.Handle);//i need to create an handle for the image control and pass it here. but i cannot do that
DsError.ThrowExceptionForHR(hr);
// Turn off captions, etc
hr = ivw.put_WindowStyle(WindowStyle.Child | WindowStyle.ClipChildren | WindowStyle.ClipSiblings);
DsError.ThrowExceptionForHR(hr);
// Yes, make it visible
hr = ivw.put_Visible(OABool.True);
DsError.ThrowExceptionForHR(hr);
// Move to upper left corner
Rectangle rc = new Rectangle();// changed from hControl.ClientRectangle
hr = ivw.SetWindowPosition(0, 0, Convert.ToInt32(hControl.Height), Convert.ToInt32(hControl.Width));
DsError.ThrowExceptionForHR(hr);
}
를 달성하기 위해 원하는 컨트롤을 느끼는 기능입니다. 덕분에 당신의 도움
하지만 그 샘플 그래버는 더 이상 사용되지 않습니다. –
하지만 제거되지는 않았습니다. 당신은 여전히 그것을 사용할 수 있습니다. – iamyz
좋습니다, 시도하겠습니다. –