AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

The motion and stream image at the same time

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

The motion and stream image at the same time

Postby phiphophe » Sat Dec 22, 2018 4:01 am

how to execute "image stream" and motion at the same time. I received this error "Bitmap region is already locked". Image has been locked to excute motion so nothing provided for picturebox at that time. Please somebody can talk for me that what should i do?. any ideas are welcome.
Code: Select all
private void video_NewFrame(object sender,NewFrameEventArgs eventArgs)
        {
            Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();
            pictureBox1.Image = bitmap;
            motion.ProcessFrame(bitmap);
        }
phiphophe
 
Posts: 5
Joined: Wed Dec 19, 2018 2:07 pm

Re: The motion and stream image at the same time

Postby andrew.kirillov » Sat Dec 22, 2018 7:55 am

First do motion processing. Then give it to picture box. Not the other way around. When image is given to picture box, it will be already locked.

Or, if you want to do it your way, then you will need to make another clone.
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3359
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: The motion and stream image at the same time

Postby phiphophe » Mon Dec 24, 2018 4:55 am

andrew.kirillov wrote:First do motion processing. Then give it to picture box. Not the other way around. When image is given to picture box, it will be already locked.

Or, if you want to do it your way, then you will need to make another clone.

thank you very much, sir.
phiphophe
 
Posts: 5
Joined: Wed Dec 19, 2018 2:07 pm




Return to AForge.NET Framework

cron