08-19-2011 02:14 AM
Hello,
I would like to centre an image on the front panel. The image is on a tab control that is fit to the pane. I can't seem to find a way. I'm working with LabVIEW 10 on a Mac. Any suggestions would very much be appreciated.
Thanks,
Michelle
Solved! Go to Solution.
08-19-2011 02:25 AM
08-19-2011 04:13 AM
Thanks Gita_A.
I have attached the relevant part of my program. It's not to do with the size but position of the image - I would like the image to be right in the centre of the tab control.
08-19-2011 04:24 AM
Hi Michmar,
use property nodes to read the size of the tab control.
Then calculate the new position of your pic indicator and move it also using it's property nodes...
Should be possible on MAC the same way like on Win-PC!
08-19-2011 11:40 AM
The property nodes do work on the Mac. I do not have time now to sort out which ones you need and the exact algorithm, but you can work that out with some experimentation and reading of the help files.
Lynn
08-21-2011 12:30 AM
Thanks everyone. I now have property nodes for the tab control (Left: -1939, Top: -6468) and I can move the pic indicator by changing it's property nodes. This may be a stupid question but how do I figure out what numbers to set to the pic's indicator property nodes so that it is exactly in the middle?
08-22-2011 09:22 AM
You will need to do some math. Get the locations of the edges of the tab control and of the picture control. The centers are at half the difference plus the top or left. I am not sure without checking but I think the values are with respect to the corner of the display. Be careful about the origin if you have multiple displays. If the differences are odd, you have a half pixel error. From the positions of the centers, you need to work back to the positions for the top and left edges. It may take some experimentation. The Bounds rectangle includes the label (I think), so keep that in mind also.
Lynn
08-25-2011 12:15 AM
Thanks everyone! Finally sorted it out. Very helpful!