LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to auto adjust front panel to fit screen resolution?

Hi,

 

I want to make all objects on the front panel such as font, buttons, indicators auto scale to fit screen resolution. I wonder if Labview have this feature? Any help will be very appreciated.

 

Thanks,

David

0 Kudos
Message 1 of 8
(17,976 Views)

untitled.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 8
(17,973 Views)

Hi, I am having similar trouble with screen resolutions on a program I have made. I made all the icons for a 1920x1080 monitor, and if I change the monitor for a smaller size, the front panel is cropped. See image for an illustration. I can remake all the icons but it takes about 1 or 2 days, I have done this for 1600x900, but the icons were slightly blurry after resizing. I need a way of making the application work on all monitors between 1024x768 and 1920x1080 automatically, without having to remake the GUI for each intermediate monitor size. I would like it to work like Mac OSX where the icons in the dock expand with a fisheye effect, but remain clear and non-fuzzy at all sizes. Is there a way of doing this? Please note, I have 4 panels in the front panel, so the autoscaling option does not work. 

screen sizes s.jpg

0 Kudos
Message 3 of 8
(17,811 Views)

Hi MadScientist!

 

I've made some research on what you ar trying to accomplish. What we've thought is that you might need to get the screen resolution pragmatically and then code the panel sizes accordingly. This is because autoscaling isn't anoption as you've mentioned.

 

I will leave you some links that I believe will be useful for building your application.

 

 Programmatically Changing Font Size of Front Panel Controls for Different Screen Resolutions

 

Programmatically Change Front Panel Size to Fill Your Monitor

 

Reference Example for Reading Screen Resolution

 

I hope this helps! Don't hesitate to post if you have any other question

 

Kind Regards

 

Carlos O

Applications Engineer

National Instruments

Message 4 of 8
(17,760 Views)

Hi Carlos, 

 

Thanks for the reply.

 

I can see some possible solutions based on what you have given me. I will work on it and post on the forums if I still can't solve it. 

 

James

0 Kudos
Message 5 of 8
(17,724 Views)

why the links do not provide the solution.

0 Kudos
Message 6 of 8
(9,159 Views)

Hi amtopp,

 

those links give you suggestions how you could (maybe) solve your problem.

(The 2nd link seems to be broken now because of its age and several changes to NI's website and this forum…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 8
(9,152 Views)

Since labview front panel objects are defined in terms of pixels, they do not inherently scale.

 

Some interfaces work pretty well using panes and "scale object to pane" type of scheme.  But these are typically more difficult to design for cluttered front panels. (you also can't use a splitter inside of a tab control)

 

Another route is to programatically set the size/position/font for each object.  This does not work for decorations and can be tricky (example. XY graph size property node is for the internal portion of graph; excludes space for axes.... so you have to use a different scaling factor than buttons).  and a tab controls "tab" does not have a font size property node.

 

While not ideal, a common approach is to design 3-5 versions of your front panel for various screen resolutions.  During your software initialization step, get the monitor resolution and load the appropriate front panel VI and center it.

 

Use the "VI Package Manger" and look at the "NI Front Panel Layout" toolkit (it's free).  This toolkit implements an approach at using property nodes for scaling.  Once you configure the front panel for a given screen resolution, you use the toolkit to save the properties of each object to file, naming the configuration.  Save 1 for each screen resolution of interest.  Then at runtime, load the configuration appropriate for current screen resolution and position it.

Message 8 of 8
(9,143 Views)