المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How can I syncronize paint events from different controls?



C# Programming
07-18-2010, 04:41 AM
Hi

I'm creating an application using the avicap dll. Currently it is still a testing app. There are two pictureboxes on the form, which are passed to the dll. Each picturebox is used for a different webcam. This all works beautifully. However when I activated both the webcams at the same time I noticed an extreme delays between the pictures from different cams and the application demands as low delays as possible. So I did some testing. First I ran two instances of the app. This showed no delays. So I thought, perhaps the delays are from running in the same thread. But that can't be, because the dll uses callbacks. So I ran a single instance of the app, but covered one of the pictures with another app (notepad). Delay was gone for as long I covered one of the pictures entirely. So it has to be the paint event. Is there a way to tell the application to sync these events? Or catch them and to sync myself?

Steven