LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to scale a GUI for 4k displays?

I develop on a standard FHD monitor (1920x1080) but now I want to run it on a higher resolution screen, probably a 4k TV. I know LabVIEW's reputation for failing to accommodate different screen sizes, scaling, and DPI. But most of that is based on forum discussions from 5+ years ago when 4k was more rare.

 

What is the best practice for putting a LabVIEW program on a 4k display these days?

  1. Set the 4k display to 1920x1080 mode?
  2. Configure the OS to 200% scaling?
  3. Write the LabVIEW GUI on a 4k display, making all controls huge, and scaling font to like 36pt?

I'd love to hear how you handle this, even better if the display compatibility issues are fixed in newer versions of LabVIEW (I'm using LabVIEW 2020).

 

Thanks,

Dan

0 Kudos
Message 1 of 7
(1,553 Views)

What about making a couple of GUIs for different sizes and start them depending on resolution? It would ofc require you to have a really decoupled GUI. Within smaller resolution changes you can have scaling so e.g. one from 720p - 1440p and one for 1441+

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 7
(1,496 Views)

Yes, my GUI is nowhere near decoupled that I could easily drop-in 1080 vs 4k scaled displays. Any good tips on how to get that amount of decoupling? All my Event Handlers are on the Front Panel's Block Diagram and I haven't found a good way to decouple that without adding lots of code complexity routing references everywhere which gets confusing.

 

But I should clarify, my original question isn't how to switch between 1080 and 4k necessarily, although it'd be nice if it's automatic. I'm not even sure how to make a single 4k-capable LabVIEW GUI. Even if I make all the objects large, the components (like borders or up/down arrows) will still be microscopic, right?

0 Kudos
Message 3 of 7
(1,488 Views)

There is concept called Model-View-Controller, that allows you to decouple UI from Business logic.

 

https://www.ni.com/docs/en-US/bundle/labview-datalogging-and-supervisory-control-module/page/lvdscco...

 

https://devs.wiresmithtech.com/blog/mvc-in-labview-library/

 

https://education.ni.com/center-of-excellence/resources/1162/improve-your-qmh-with-principles-from-t...

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 7
(1,474 Views)

@OneOfTheDans wrote:

I develop on a standard FHD monitor (1920x1080) but now I want to run it on a higher resolution screen, probably a 4k TV. I know LabVIEW's reputation for failing to accommodate different screen sizes, scaling, and DPI. But most of that is based on forum discussions from 5+ years ago when 4k was more rare.

 

What is the best practice for putting a LabVIEW program on a 4k display these days?

  1. Set the 4k display to 1920x1080 mode?
  2. Configure the OS to 200% scaling?
  3. Write the LabVIEW GUI on a 4k display, making all controls huge, and scaling font to like 36pt?

I'd love to hear how you handle this, even better if the display compatibility issues are fixed in newer versions of LabVIEW (I'm using LabVIEW 2020).


4) Why do you need to make your window full screen? Just make it in whatever size that seems practical. If you want to go very fancy you can start looking into letting the user resize the window. If you use panes for different areas of your front panel, you can configure them in which direction (if any) they should resize with the overall window.

 

As to scaling of screens, that is generally a bad selection. It doesn't even work cleanly in Microsoft applications, although they do generally not have the same kind of mix and match between text controls and other stuff as you see in LabVIEW. As long as it is all just text, the pretty limited text scaling of Windows doesn't really matter, but it gets a pain in the ass if you mix text with other non-text elements that have different scaling rules than what Windows wants to do with text.

 

Text on a 200% scaled display is not double the height and double the length of the original but something else, also depending on the selected font. Either LabVIEW tries to scale the text box boundary around the text or it ends up cutting off part of the text. But if it scales it according to the contained text it messes up other alignment with other elements. It's a true catch 22 with no clean solution.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 7
(1,458 Views)

@OneOfTheDans wrote:

Yes, my GUI is nowhere near decoupled that I could easily drop-in 1080 vs 4k scaled displays. Any good tips on how to get that amount of decoupling? All my Event Handlers are on the Front Panel's Block Diagram and I haven't found a good way to decouple that without adding lots of code complexity routing references everywhere which gets confusing.

 

But I should clarify, my original question isn't how to switch between 1080 and 4k necessarily, although it'd be nice if it's automatic. I'm not even sure how to make a single 4k-capable LabVIEW GUI. Even if I make all the objects large, the components (like borders or up/down arrows) will still be microscopic, right?


You're right. Just scaling stuff will create lots of issues. So either you'll have to create scaling code to move and scale stuff (or tweak the auto function, maybe just scale the fonts) or create a couple of 'reference size GUIs'. 

If you imagine a standard Producer/Consumer where the Producer is the GUI and the Consumer sends information back via a user event, they can be separate VIs and any GUI/Producer can be spawned, that was my thought.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 7
(1,432 Views)

I've heard about MVC but never known how to really implement it, especially in LabVIEW. Thanks santo for sharing those references, I look forward to learning more about this design pattern!

 

rolfk & Yamaeda, it's not that I want the application to be full screen, or even dynamically switch between FHD and 4k (although that would be very convenient). It seems LabVIEW fundamentally doesn't support 4k displays. Even if I manually make everything (fonts, text boxes, etc.) 4x larger, there are pieces of LabVIEW that do not scale. For example the Graph Palette will be much smaller on a high resolution display. All these little things add up to a pretty bad GUI, and of course a lot of extra work to make everything huge.

 

Thanks for the caution about using 200% scaling & text as that was my leading plan. At this point it's sounding like LabVIEW simply doesn't support higher resolution displays, and my best bet is to change the display to FHD at 1920x1080.

0 Kudos
Message 7 of 7
(1,425 Views)