LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mouse click to determine colour in picture control

Hello All,

I am developing a compass with an arrow and an icon indicator, each of these items can rotate 0 to 359 degrees. The Windows device has a touchscreen, the requirement is... tapping on the arrow or graphic will cause a numeric keypad to be displayed allowing a new angle to be set. See the attached image. The red elipse indicates a typical finger press.

 

I can determine the centre of a finger tap using a mouse down event and determine the colour at that location but often it misses the arrow or icon and returns the background. I thought about extending the centre coords to typically 50 x 50 pixels then searching for the colour in the ROI, just not sure how to search for a colour in an area. I have Bitman graphics library installed, could this help?

 

Advice appreciated.

 

Regards

Chris

 

0 Kudos
Message 1 of 3
(2,383 Views)

Post your code.  What you are trying to do is probably possible but it is hard to say what would work best for you without knowing more about how the software is put together.

0 Kudos
Message 2 of 3
(2,368 Views)

One thing that's not clear to me is why you're relying on the color. Since you know where the user clicked and you draw the image yourself, why not use that info to determine which object the click is closest to? The logic for that should be as simple as the Pythagorean theorm (plus a conversion from Cartesian to polar coordinates if you want to determine the angle) and you can discount clicks if they are too far from either target.


___________________
Try to take over the world!
0 Kudos
Message 3 of 3
(2,325 Views)