LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Maintaiing aspect ratio while resizing window

I have a VI front panel that I want users to be able to interactively resize.

Under the VI properties I can either set the option for scaling the front panel objects with the window on or off.

When the user makes the window large or small, I want to the image of the objects on the panel to zoom with the window which works very well the rescaling option on.

However, I need to maintain the objects' aspect ratio. In other words, I need a square to not change into a rectangle and a circle to not change into a oval if the user makes the window long and narrow for example.

Any ideas on how to best go about this? I have thought about letting LabView rescale the objects with the window and then programmatically changing
the objects' proportions so as to maintain the aspect ratio. However, at this time I am not aware how to trigger an event on the window changing shape other than constantly polling and comparing to the previous value which is guaranteed to slow the rest of the program down.

Thanks,
Brett
0 Kudos
Message 1 of 4
(3,431 Views)
> Any ideas on how to best go about this? I have thought about letting
> LabView rescale the objects with the window and then programmatically
> changing the objects' proportions so as to maintain the aspect ratio.
> However, at this time I am not aware how to trigger an event on the
> window changing shape other than constantly polling and comparing to
> the previous value which is guaranteed to slow the rest of the program
> down.
>

If you don't have an event structure that can notify you when the resize
takes place, use the property nodes to compare and detect a grow. The
key is to do this only a few times a second. This will add very minimal
overhead.

Greg McKaskle
0 Kudos
Message 2 of 4
(3,431 Views)
I am using event strucures in LV 6.1 Pro.

But I can't find any option to trigger an event on a resize of the panel! (I can trigger an event on the panel closing, though.)

How do I set-up this event case as you described?

Thanks,
Brett
0 Kudos
Message 3 of 4
(3,431 Views)
Brett Kornfeld wrote:
>But I can't find any option to trigger an event on
>a resize of the panel! (I can trigger an event on
>the panel closing, though.)


There isn't one. Greg is probably using 7.0. 😉

I can trigger an occurrance while winddow sizing.
Just like the Redraw Event in G Toolbox. I'll send
it to you via private mail.

George Zou
http://gtoolbox.yeah.net
George Zou
0 Kudos
Message 4 of 4
(3,431 Views)