PDA

View Full Version : cant update form controls while using Imaging Control



Anker
July 3, 2009, 09:52:37
Im using the imaging control, with live camera feed.
And on that im using the overlayBitmap to draw squares, rezise them and move them around. Using mouseDown, mouseMove and mouseUp.
This works fine.

On the form i got some textbox with the coordinates and a listbox marking the name of the square i click.
But when i run it in debug mode it wont update the controls.
it seems that the procedure in witch i do it gets interuptet or terminatet.
Sometimes it looks like it could be a mouseMove that does it, but im not sure.
some of the errors i get.
from the combo box:
comboBoxBarcodeTypes.SelectedItem' threw an exception of type 'System.InvalidOperationException'
and from output:
The thread 0x1348 has exited with code 0 (0x0).
The thread 0x1364 has exited with code 0 (0x0).

i got allmost the same code with squares, but on a paintbox, and there is no problems there.

How do i updates controls on a form while using the mouseMove and mouseDown events on the image control?

Stefan Geissler
July 3, 2009, 10:27:04
Hello Anker,

if you use the IC mouse events, you may must need Delegates to display the mouse coordinates on your form, because IC uses an own thread. Do you know, how to use Delegates?

Anker
July 3, 2009, 12:22:14
ok thanks, it seems to do the trick.