Telerik Forums
UI for WPF Forum
1 answer
2 views

Is Telerik WPF WebCam control supported in .NET 6? If so, what package contains the definition for RadWebCam?

Thanks.

Mark
Top achievements
Rank 1
Iron
 answered on 24 Apr 2024
1 answer
96 views

Hello,

I am developing an app for a Windows 10 Tablet that requires a picture to be taken.

I have set up a RadWebCam control, but when I open the settings menu on the tablet it takes 2-3 minutes of "Not Responding" before it loads the settings menu. Additionally it is very slow when adjusting the settings. The only reason I need the settings is for the Zoom control. Is it possible for me to change the zoom programmatically? I would like to add a +/- zoom button, but I cannot find anything on how to do this.

My second issue is that the app needs to run in portrait mode, but the camera is in horizontal mode. Is there any way I can change the rotation of the web cam? If I rotate the control it will rotate the bottom panel as well.

 

Martin Ivanov
Telerik team
 answered on 25 Aug 2023
1 answer
161 views

No video is shown when the camera starts and calling the TakeSnapshot method results in an exception in PresentationCore.CriticalFromVisual, with the message "parameter v cannot be null'.  

I've provided a simple test app that reproduces the problem. Platform is Windows 10, and the app is a .NET 5.0 WPF app using the latest Telerik UI for WPF nuget package. I have tried AnyCPU, x64 and x86 and the behavior is the same for all configurations, both release and debug. 

I have tested on a desktop machine with a Logitech 910 webcam and on a Surface Pro 3 using the internal camera. The identical code works fine on WPF .NET Framework 4.7.2 on both devices.

Project file is attached. 

Here is the window xaml:

 

<Window x:Class="cameratest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:cameratest"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        mc:Ignorable="d"
        Title="MainWindow"
        Height="450"
        Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Button Width="80"
                Margin="4"
                HorizontalAlignment="Left"
                Click="OnSnapClick">Snap</Button>
        <telerik:RadWebCam Grid.Row="1"
                           x:Name="radWebCam" />
    </Grid>
</Window>


And the code behind:


using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Media.Imaging;
using Telerik.Windows.Controls;
using Telerik.Windows.MediaFoundation;

namespace cameratest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            radWebCam.SnapshotTaken += RadWebCamOnSnapshotTaken;
            radWebCam.CameraError += RadWebCamOnCameraError;
        }

        private void RadWebCamOnCameraError(object sender, CameraErrorEventArgs e)
        {
            Debug.WriteLine(e.Error.Message);
        }

        private void RadWebCamOnSnapshotTaken(object sender, SnapshotTakenEventArgs e)
        {
            BitmapSource snapshot = e.Snapshot;
        }

        private void OnSnapClick(object sender, RoutedEventArgs e)
        {
            radWebCam.TakeSnapshot();
        }
    }
}

 

Modifying the app to disable auto start and initialize and state the camera manually results in the same problem.

 

 

Stenly
Telerik team
 answered on 13 Sep 2021
5 answers
270 views

Hi,

I have tried the WPF webcam demo and I can't get it to work. Do I have to change any security settings to allow the demo program to access my webcam?

Also the application crash after a few tries taking a picture. If I try recording i crashes directly.

I use WPF Demo 2020 R1 and Telerik Ui for WPF R1 2020.

OS is Win10 Enterprise, Version 1607.

Martin Ivanov
Telerik team
 answered on 31 Aug 2020
1 answer
106 views

Is the webcam control capable of using Onvif compatible net cameras? Onvif is a protocol and hundreds of security cameras support it, see: https://www.onvif.org/ for further details.

Windows 10 2004 also supports it. But before I buy such a camera I wanted to know if the webcam control can use it? https://blogs.windows.com/windowsdeveloper/2019/10/15/announcing-windows-10-support-for-network-cameras/.

More details to connect a camera, here: https://blogs.windows.com/windowsdeveloper/2019/10/10/connecting-network-cameras-to-windows-10-devices/#q0HZLYwmvHbx7F2e.97.

Thanks

Mike

Ivan Petrov
Telerik team
 answered on 10 Aug 2020
1 answer
138 views

Hello

I want to buy DevCraft Complete, I want to be confirmed that I can use RadWebCam with digital camera instead of web cam, my application  senario is as following:

I want to connect the digital camera to the PC (sony or canon digital camera) then when I open the window that has RadWebCam conrol, the user can capture the photo from the digital camera instead of capture the photo from the camera it self (using the capture button on the camera)

Is this possible with WebCam control?

Thanks

Abdulsalam

Ivan Petrov
Telerik team
 answered on 21 Jul 2020
0 answers
67 views

Hallo, I'm using RadWebCam control into a UserControl and everything works as expected.

So, if I call myradwebcam.TakeSnapShot() within the UserControl that contains the RadWebCam control, everything is ok.

But if I call myradwebcam.TakeSnapShot() from another class (i.e. another UserControl) I receive a System.NullReferenceException.

Am I doing something wrong?

 

Thank's,

Luca

P.S. Here the exception:

 

System.NullReferenceException
  HResult=0x80004003
  Messaggio=Riferimento a un oggetto non impostato su un'istanza di oggetto.
  Origine=Telerik.Windows.Controls.Media
  Analisi dello stack:
   in Telerik.Windows.Controls.RadWebCam.TakeSnapshot()
   in TestVisoreIfm.Pannello_Dashboard.btnScansione_Click(Object sender, RoutedEventArgs e) in D:\repos\TestVisoreIfm\Pannello_Dashboard.xaml.cs: riga 517

Luca
Top achievements
Rank 1
 asked on 11 Jun 2020
4 answers
240 views

Hi!

I couldn't find any information about selecting which camera I want to use in RadWebCam. Any sample? Or is it not possible?

Also there should be a way to save and load the settings of a camera.Any hints?

Thanks

Rémi
Top achievements
Rank 1
 answered on 14 Aug 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?