dbremner / aforge

Automatically exported from code.google.com/p/aforge
Other
0 stars 0 forks source link

I am using this construction to save one image after 10 seconds. #291

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using?

Please provide any additional information below.

Original issue reported on code.google.com by deraldo....@gmail.com on 6 Mar 2012 at 4:39

GoogleCodeExporter commented 8 years ago
wow. 
continuing.
            count++;
            image = (Bitmap)eventArgs.Frame.Clone();
            if (count == 10)
            {
                string filename = dir + DateTime.Now.ToString("yyyyMMddHHmmss") + Form1.nomeFoto.ToString().PadLeft(2, '0') + Form1.valortempo.ToString().PadLeft(2, '0') + ".jpg";

                Image img = image;
                img.Save(filename, ImageFormat.Jpeg);
                count = 0;
            }
in the newframe routine.
Executing the program in my desktop computer, everything is running ok. But, if 
I run the program im my laptop (a W510 Lenovo) I got this error:
"Parameter is not valid" in the line 1479 of the VideoCaptureDevice.cs
Debugging it, i found that all parameters are the same since the beggining of 
the execution. Until the error, 17 images were been captured.
any ideas?
thx in advance

Original comment by deraldo....@gmail.com on 6 Mar 2012 at 4:49

GoogleCodeExporter commented 8 years ago
Did you try disposing images after you've cloned them?

Original comment by andrew.k...@gmail.com on 6 Mar 2012 at 5:32

GoogleCodeExporter commented 8 years ago
Ok.resolved.
thx for your attention.

Original comment by deraldo....@gmail.com on 6 Mar 2012 at 8:36