LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Image Display Size

Hi All,

I have a window whose front panel is completely covered with the new Image
Display control in IMAQ 7.

Ideally this window would act as a image display. So as the operator
changes the size of the window, the image display control would resize
itself to cover the entire window.

Our initial iteration of this uses the property "Scale all objects on front
panel as the window resize". Setting this property for the VI achieves the
required behavior of resizing the image control when the window is resized,
however, we are finding that the size of the image display never exactly
matches the window size. Specifically, when the window is sized 'small' the
image display takes up less then the whole window. When the window is sized
'large' the image
display takes up more then the window size.

We could not get this to work properly so we thought that we could manually
watch for a panel resize, and programmatically resize the image display.
The problem with this is that there is no property available to WRITE the
size of the image display.

So I am hoping that someone here as managed to get something similar to this
to work. If you can offer any advice, please do so.

Also, if anyone has answers or insight to the following questions, please
share them:

1) why don't ALL controls have a writable BOUNDS property.
2) why doesn't "Scale all objects on front panel as the window resize"
maintain proper scale for the control on the front panel..

Thanks in advance.

Denis
0 Kudos
Message 1 of 3
(3,078 Views)
> 1) why don't ALL controls have a writable BOUNDS property.
> 2) why doesn't "Scale all objects on front panel as the window resize"
> maintain proper scale for the control on the front panel..
>

I'm not at a PC at the moment, so I can't look to see if there is a
property for setting the bounds, but I beieve there is. Look lower down
in the menu for something named more specific to the Image control.

As for your other questions, here are my answers.
1. The bounds property is read-only and it is a very basic property
exposed by the GObject class. The problem is that most controls in LV
aren't rectangular, and they often have interesting limitations placed
on the bounds of certain parts. For this reason, the control inherits a
general overall bounds
property that includes the label and all other
parts. Many of them will then implement another property read/write
that is specific to the object you normally resize in the editor.

2. The resize all objects does what it can, but again, there are many
special limitations such as objects that must maintain a certain aspect
ratio or grow by an increment because they display an integer number of
lines. These special cases combined with the fact that the math is
performed in integers and rewritten into the bounds of the object mean
that the true ratio between objects on the panel can accumulate
roundoff. Both of these contribute to the problem.

You might want to consider using the other sizing option -- sizing one
object or group of objects with the window. This is the more typical
choice for most applications. Size All was put in for a few special
cases, and IMO should rarely be used.

Greg McKaskle
0 Kudos
Message 2 of 3
(3,076 Views)
Just to add to the response by Greg, please read the following KB Front Panel Objects Misaligned...
It explains what you maybe seeing.
Feroz
0 Kudos
Message 3 of 3
(3,076 Views)