Unplanned
Last Updated: 05 Mar 2020 10:03 by ADMIN
Gilles
Created on: 05 Mar 2020 10:03
Category: UI for WinForms
Type: Bug Report
0
RadWebCam: An exception is thrown if you take snapshot too soon

How to reproduce:

private void RadForm1_Load(object sender, EventArgs e)
{
    this.radWebCam1.TakeSnapshot();
}

Workaround:

public class CustomWebCam : RadWebCam
{
    public override void TakeSnapshot()
    {
        FieldInfo fi = typeof(RadWebCam).GetField("player", BindingFlags.NonPublic | BindingFlags.Instance);
        object value = fi.GetValue(this);

        if (value == null)
        {
            return;
        }

        PropertyInfo propertyInfo = value.GetType().GetProperty("EvrVideoDisplay", BindingFlags.NonPublic | BindingFlags.Instance);
        value = propertyInfo.GetValue(value, null);

        if (value == null)
        {
            return;
        }

        base.TakeSnapshot();
    }
}

0 comments