Je veux afficher la sortie WEBCAM sur un contrôle IMAGE dans WPF pendant que l'utilisateur se positionne pour prendre un passeport. J'utilise la bibliothèque DirectShow et je peux capturer l'image et le placer dans le contrôle Image, mais le contrôle Image reste vide jusqu'à ce que je capture l'image. S'il vous plaît comment puis-je m'assurer que le contrôle de l'image montre la sortie de la webcam avant que l'utilisateur ne capture son image? Mercicomment héberger la sortie d'une Webcam à l'intérieur d'un WPF ImageControl en utilisant directShow
c'est la fonction que je ressens contrôle ce que je veux réaliser
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);
}
je l'ai commenté la ligne que je pense que mon problème vient. Merci pour votre aide
mais j'ai lu que l'échantillonneur d'échantillons est déprécié –
Mais pas supprimé. Vous pouvez toujours l'utiliser. – iamyz
ok, laissez-moi essayer –