If the feed is paused and I re-size or move the app on my desktop, the camera image also goes blank.
1. Run the project and press Space to pause the camera.
2. Resize the form. You will notice that the paused image gets blank.
Workaround:
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
this.radWebCam1.Resize += RadWebCam1_Resize;
}
Timer t = new Timer();
bool isPaused = false;
private void RadWebCam1_Resize(object sender, EventArgs e)
{
t.Stop();
if (isPaused)
{
t = new Timer();
t.Interval = 100;
t.Tick += T_Tick;
this.radWebCam1.Start();
t.Start();
}
}
private void T_Tick(object sender, EventArgs e)
{
this.radWebCam1.Pause();
isPaused = true;
t.Stop();
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Space)
{
this.radWebCam1.Pause();
isPaused = true;
}
return base.ProcessCmdKey(ref msg, keyData);
}