Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Image show from another thread

I'm still working on multithreading in VB .Net, and having many problems.

Given that I have my two viewers on the main form of the application, and I've started later two threads that acquire images from two different cameras, does exist a "right way" to show this two images in the respective viewer on the main application form?

By now I'm using Viewer.attach on the Image objects were I'll acquire images later from the threads but, when running the two threads in parallel, the main form gets corrupted (no buttons showed or partial, partial frame around the viewers, etc...). Those problems disappear if I do not attach the images to the viewer or if I run only one thread.

I know about the problem of accessing main window controls from another thread and tried also using a delegate function to update the viewer but this solution doesn't solved the problem. Is ther a "right way" to do this job or it is not possible?

Thanks for the help,

Simone
--
Simone
0 Kudos
Message 1 of 3
(3,220 Views)
...Continued...
In addition to those facts, when I use timers (from windows.forms.timer) to run asyncronously the two inspections I have no one of the problems discussed above, but I've a low execution speed (about 8-9 execution per second against 40 execution per second using threads), even setting the timer interval to 1 ms.


--
Simone
0 Kudos
Message 2 of 3
(3,210 Views)
I solved the problem: It was only a bug on my software Smiley Mad


--
Simone
0 Kudos
Message 3 of 3
(3,195 Views)