12-15-2009 05:59 PM
Darin.K
Thanks for the program, I was able to modify it to work for my application. I cannot however find a good way to be able to double click on a point in the image and automatically zoom-in say by a factor of 1 and move the image so that the point where you double click is on the center of the new zoom. Do you have any chunks of code that may be able to do that?
Thanks
12-15-2009 06:39 PM
We'll let this be an exercise for the reader, I'll get you started and be sure to let me know if you start to have trouble. This is from memory, so beware.
1) Create a new event case, Picture->Mouse Down? (this is a filter event)
2) Wire the Button output to a case structure, we want action if Button 1 is double clicked, nothing otherwise
3) In the '1' Case, unbundle (by name) the Mods output from the Event structure, select Double Click? Wire this to the Discard? input on the right. We will toss out double clicks of Button one, also wire this to another case structure inside the '1' case.
4) In the true case, you need to take the coords output and do some math. The coords you get are in terms of the front panel, so if you would like to convert to picture coords you need to grab the top,left corner using a property node. Using these coords, set the new origin and zoom factor.
should do the trick. I would probably write some subVIs to do the coord math so things don't look too hairy. Again, let me know if you have trouble along the way, there are several steps, but none of them are too difficult.