09-12-2014 10:21 AM
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
09-12-2014 11:44 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-13-2014 12:08 PM
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.