To reproduce, run the sample project that uses the following code snippet:
public partial class MainForm : Telerik.WinControls.UI.RadForm
{
public MainForm()
{
InitializeComponent();
}
private void radButton1_Click(object sender, EventArgs e)
{
using (CameraForm f = new CameraForm())
{
f.ShowDialog();
}
}
}
public partial class CameraForm : Telerik.WinControls.UI.RadForm
{
public CameraForm()
{
InitializeComponent();
}
private void CameraForm_FormClosing(object sender, FormClosingEventArgs e)
{
this.radWebCam1.Stop();
}
private void CameraForm_Load(object sender, EventArgs e)
{
ReadOnlyCollection<MediaFoundationDeviceInfo> videoDevices = RadWebCam.GetVideoCaptureDevices();
ReadOnlyCollection<MediaFoundationVideoFormatInfo> videoFormats = RadWebCam.GetVideoFormats(videoDevices[0], true);
radWebCam1.Initialize(videoDevices[0], videoFormats[0]);
radWebCam1.Start();
}
}
Note: please have in mind that the issue may not occur the first time you close the CameraForm.