WebEye.Controls.Wpf图像是颠倒的

时间:2016-10-06 05:53:40

标签: c# wpf webcam

我们使用WebEye.Controls.Wpf作为网络摄像头控制器,但由于我们已将平板电脑更换为华硕变压器,因此图像是颠倒的。

WPF:

        <wpf:WebCameraControl x:Name="webCameraControl" Margin="150,50,150,100" />

C#

    private void start_Click(object sender, RoutedEventArgs e)
    {
        if (fullOrderId == "")
        {
            MessageBox.Show("You need order id to take pictures", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            Close();
        }
        else
        {
            var cameraId = (WebCameraId)cams.SelectedItem;
            //RotateTransform rotateTransform = new RotateTransform(180);
            //webCameraControl.RenderTransform = rotateTransform;
            webCameraControl.StartCapture(cameraId);
        }
    }

正如你所看到的,我已经尝试过180度旋转,但图像是一样的。

1 个答案:

答案 0 :(得分:0)

似乎是asus驱动程序的问题,所以请联系asus支持(有关该问题的FAQ网站:https://www.asus.com/us/support/faq/109836/)。

除此之外,您还需要通过

另外指定旋转的中心点
webCameraControl.RenderTransformOrigin.X = 0.5;
webCameraControl.RenderTransformOrigin.Y = 0.5;

或通过

创建RotateTransform
RotateTransform rotateTransform = new RotateTransform(180, 0.5, 0.5);

请参阅How to do rotation around control's center in XAML