From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-06-2019 12:36 AM
Hi,
Instead of mouse wheel zoom, is it possible the rubber-band zoom to zoom the polar plot picture indicator?
Regards,
S Nagaraju
Solved! Go to Solution.
02-06-2019 02:37 AM
The indicator is a plain 2D picture, so you can look for mouse-down events and interactively draw a rubber band. Use a mouse-donw event to get the first corner, then a mouse-move event to draw a square between that corner and the mouse position. Redraw the zoomed area on mouse up, etc..
(for some ideas, see how I added an interactive selection circle is this old example.)
02-06-2019 06:47 AM
Hello sir,
Thank you very much for the quick response. With your suggestion i have done up to some extent. Now I'm facing issue during mouse up event. The selected area is not able to adjust to the full picture.
Kindly check the enclosed VI and suggest me for further changes.
Regards,
S Nagaraju
02-06-2019 07:14 AM
You did a good job getting a section of the picture, but you forgot to do any zooming.
You may need to add some special code so that when you scale it up, it picks a scale factor that allows your image subset to fit. It is unlikely that you'll pick a rectangle with the same aspect ratio as your picture indicator, so either one direction of the picture would get cut off, or the other direction will need to have a larger area shown than what you drew with the rectangle.
02-06-2019 11:52 AM
@Sonti_11532 wrote:
Hello sir,
Thank you very much for the quick response. With your suggestion i have done up to some extent. Now I'm facing issue during mouse up event. The selected area is not able to adjust to the full picture.
Kindly check the enclosed VI and suggest me for further changes.
Regards,
S Nagaraju
I would do something like this:
02-06-2019 12:46 PM
Here is how I would do it with the zoom factor based on the relative sizes of the original picture and the zoom rectangle that doesn't cut anything off.
02-07-2019 12:35 AM - edited 02-07-2019 12:46 AM
Hello sir,
Thank you very much for the solution. I have modified the VI as per my requirements because i'm having only one picture control and we can do the multi level zoom in the displayed area. I have observed few things
1. The behavior is abnormal, If I do mouse down in the picture control and drag out of the picture then mouse up or vice-versa.
2. During Muse up event, the rectangle to be disappeared. I tried, but still rectangle is visible.
Kindly look in to the modified VI and suggest me for the changes.
Regards,
S Nagaraju.
02-07-2019 08:05 AM
1. Add a Mouse Leave Event. In there you can put code that ends the entire mouse draw operation resetting your flags.
2. (And you'll want this for #1 as well) Put your terminal for the original polar plot inside the mouse up event and use a local variable outside for the one time you initialize the plot. When you have a mouse up, send the original picture to the original plot. This will give you a view without the rectangle that the mouse draw process created.
02-07-2019 09:26 AM
@RavensFan wrote:
Here is how I would do it with the zoom factor based on the relative sizes of the original picture and the zoom rectangle that doesn't cut anything off.
thank you!
02-07-2019 10:27 PM
Thank you very much.