|
Had you debugged it, you'd have noticed immediately that there was no loop condition and that the background worker completes after one run through.
|
|
|
|
|
I have made the necessary changes.
It seems to be working as a new thread now.
I will continue testing and come back to you if there is a query.
Thank you
|
|
|
|
|
Unfortunately, you (you specifically -- and a couple of other guys) continue to spoon feed him and hold his hand on *every* question (and yeah, he asks a ton), so why should he bother to learn how to do anything for himself? He knows that when he hits F5 and something bad happens, its off to the CP forums and good ol' Pete and good ol' Griff will hold his hand as usual and wipe his butt for him. Although, I have noticed lately, you seem to be getting annoyed with him , so maybe you'll stop with the hand holding soon and Arkiboys will finally man the f up and learn his craft. However, I think its pretty obvious that Arkiboys doesn't really have any interest in learning anything because people point him to links, etc. and he still comes back 5 seconds later and says "but... its too hard... ".
Not bashing you in general Pete, I think its great that you help everybody out...
... but in the case of Arkiboys? the guy is just clueless and hopeless. I only read his threads for strictly comedic purposes.
|
|
|
|
|
Your code only starts the background worker thread once - in your Initialize() function. All the Tread.Sleep(200) does is to pause the excution of the background worker's DoWork event handler for 200 milliseconds.
If you want to run the background worker thread event every 200 milliseconds, you would need to create a timer that fires its Elapsed event every 200 milliseconds. In the timer's Elapsed event handler, you would invoke the background worker RunWorkerAsync() method.
|
|
|
|
|
Do you mean like this?
private System.Timers.Timer timerStatus = new System.Timers.Timer(200);
Initialize()
{
_backgroundWorker = new BackgroundWorker();
_backgroundWorker.WorkerSupportsCancellation = true;
_backgroundWorker.WorkerReportsProgress = true;
_backgroundWorker.DoWork += new DoWorkEventHandler(BackgroundWorker_DoWork);
_backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_backgroundWorker_RunWorkerCompleted);
timerStatus.Elapsed += new System.Timers.ElapsedEventHandler(OnElapsedTimeStatus);
timerStatus.Enabled = true;
}
private void OnElapsedTimeStatus(object source, System.Timers.ElapsedEventArgs e)
{
_backgroundWorker.RunWorkerAsync();
}
private void BackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
if (_backgroundWorker.CancellationPending)
{
e.Cancel = true;
return;
}
MonitorStatus();
}
|
|
|
|
|
Yes - that's what I mean.
|
|
|
|
|
I think I have it working now but I will continue to debug and test...
Is it ok, to use a while loop instead of a timer?
|
|
|
|
|
I would not recommend it. You might get away with it if the while loop was running in it's own separate thread.
|
|
|
|
|
|
Hello everyone,
A lot of examples that are given in this type of problem but i didnt found the working solution.
My problem is to create an ASPX page that will capture an image from a webcam.
I know there its hard to find simple solution but i'l be asking f someone can provide me one simplified
solution regarding this problem..
im no expert in writing a web page thing.
thank you in advance.
xxx
|
|
|
|
|
|
I already registered the Dll but it gives me an error.. May i know how i solve it..
"Retrieving the COM class factory for component with CLSID {D6BA1539-8473-497C-92C3-8ECF63DAC0F3} failed due to the following error: 80040154."
tnx.
xxx
|
|
|
|
|
Did you register the DLL in your system?
I must get a clever new signature for 2011.
|
|
|
|
|
yes i did...
now i have another error... "ERROR GrabFrame()
//Jpeg compression quality
short nQuality = 45;
//Shout a picture from my webcam
CAMSERVERLib.Camera cam = new CAMSERVERLib.CameraClass();
byte[] picture = (byte[])cam.GrabFrame(nQuality); ---> "ERROR GrabFrame().
//Add the hour to the jpeg picture
MemoryStream ms = new MemoryStream( picture );
Bitmap bmp = new Bitmap( ms );
xxx
|
|
|
|
|
The_Collector wrote: now i have another error... "ERROR GrabFrame()
What error?
I must get a clever new signature for 2011.
|
|
|
|
|
the words in BOLD is d ERRROR... "ERROR GrabFrame()"
xxx
|
|
|
|
|
the words in BOLD is d ERRROR... "ERROR GrabFrame()"
xxx
|
|
|
|
|
Well that makes it so much clearer.
I must get a clever new signature for 2011.
|
|
|
|
|
i dont understand...
but anyway, thanks for your effort....
just want to have a clearer answer on this things...
xxx
|
|
|
|
|
The_Collector wrote: i dont understand...
Nor do I, all you have said is "the words in BOLD is d ERRROR... "ERROR GrabFrame()"", which tells us nothing. What error, what messages, what status codes, what exceptions, etc? People reading this cannot guess what happens on your system.
I must get a clever new signature for 2011.
|
|
|
|
|
its a camserver.dll which doesn't give any error numbers or description, just this error....
xxx
|
|
|
|
|
So how exactly do you think anyone can guess what the problem is? I suggest you go to the site or supplier of the DLL and ask them for more information.
I must get a clever new signature for 2011.
|
|
|
|
|
i guess so... i'l try to reach d programmer of this dll or look for another dll..
thanks.
xxx
|
|
|
|
|
In addition tp pravin answer I also suggest you to go there[^] to download a sample application to learn how to capture image using webcam.
|
|
|
|
|
this is a windows application,,, Im looking for ASPX page.
thank you
xxx
|
|
|
|