Completed
Last Updated: 23 Sep 2022 13:07 by ADMIN
Release R3 2022
David
Created on: 11 Aug 2022 06:48
Category: WebCam
Type: Bug Report
0
RadWebCam: paused camera gets blank after resizing

 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);
        }

2 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 18 Aug 2022 06:59

Hi, David,

I agree with you that it will cause a "jump" in the displayed frame. An alternative approach that I can suggest is instead of using the Pause method, take a snapshot with enabled preview. Thus, after resizing, the image will be resized accordingly, not the paused video streaming:

                this.radWebCam1.PreviewSnapshots = true;
                this.radWebCam1.TakeSnapshot();

Please have in mind that the item is currently in development and it is scheduled for the upcoming release. Stay tuned.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


David
Posted on: 17 Aug 2022 15:57
This isn't really a good workaround for our case because it will cause a "jump" in the display.  Our application is a medical camera, probing inside a body, and subject to continuous movement of the camera and subject. So the image that the feed is paused on will not be the image that is seen after re-pausing, no matter how quickly the start/pause cycle is processed.