LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to resize the front panel to fit different resolutions

I m using LabVIEW 8.2 on Windows XP SP2
 
I've tried both “maintain proportions of window for different monitor resolutions” and “scale all objects on front panel as the window resizes” selected but just messed up everything when i switched to another different resolution. It's annoying since I'm using 22 inch monitor to do the coding but the user supposed to run it on laptop or wince.
 
Any solutions to it?
 
Thx in advance.
0 Kudos
Message 1 of 12
(13,057 Views)

Hi ibudder,

      I think VIs are available on this site that will retrieve the current display-dimensions, probably OpenG has something, and worse-case I promise to build a VI which pulls this info from a DLL in the Windows API, if you really need it!  But, are you planning to dynamically position controls(?) - it can be really messy code-wise (a lot of work to support a bigger FP in the IDE.)

On the other hand, my approach is so low-tech you may be insulted by the mere suggestion!  Still, here's what I do:

1) change the IDE to use the lower screen resolution while proportioning the GUI

2) Once the VI FP is sized for the lower-resolution, switch the IDE back to a comfortable development resolution, but dont' resize the VI's FP.

Just an idea!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Message 2 of 12
(13,039 Views)
Thank you for sharing your idea. The ScreenRes.dll is to retrieve the current resolution of the computer screen. But the problem now is we finished lv code and then we realized we needed to support down to 800*600 screen. So we need some support or software which can resize the front panel.
0 Kudos
Message 3 of 12
(13,017 Views)
I've searched all the resources here seems lots of ppl have the same question. But I still can't find any solution. Esp when you use tab in the front panel everything messed up. Does NI really have a solution or not?
0 Kudos
Message 4 of 12
(13,004 Views)
Haven't tried this, just a thought, but...

Would it be possible to manually create front panels for different resolutions, and have the VI check which one to load on startup? I don't know if you can make different front panels for one block diagram, but I just thought of this.

Hmmmm, I might have to try. My current solution is just "make them scroll," but I can see how that would be not a good idea.

Edit: Well, I guess you could have your entire VI in a case structure, such that the case in use is determined by the current resolution and only the active case structure has visible objects, i.e. all other sizes get hidden and the window size is set programmatically by the case. These notions may be rather harsh on memory usage, though, and they're very "brute force" in implementation. Still, it's what comes to my mind.

Message Edited by DJDDA on 01-18-2008 03:31 PM
0 Kudos
Message 5 of 12
(13,000 Views)
Thanks for sharing your point. So that turns out to be 1. get current screen resolution; (easy to achieve) 2. call whichever front panels.(lots of work) But what if the front panel involves lots of pics, images and customized icons? I tried to figure out how to use “maintain proportions of window for different monitor resolutions” and “scale all objects on front panel as the window resizes” in VI properties but it doesn't look like the way I want. Or is there any property nodes or invoke nodes I can use? Tried to open vi ref and called panel property node but doesn't sound good either.
0 Kudos
Message 6 of 12
(12,992 Views)
This is a long-standing issue with programming in almost any language, but especially LabVIEW. I have build many applications that had to look right in multiple resolutions (especially on a PDA where the user may be in Portrait or Landscape mode.) In almost every case, I've had to build multiple VI's and then create a main VI that checks the screen resolution, and then calls the appropriate subVI with a case statement.

I have never had much success with the "Maintain proportions" as invaribly some or most things look wakky. Luckily, after building and testing the program once, its very easy to make a copy, re-arrange just the front panel, and save it as a different VI. I usually have my Main VI, then two or three copies of the SubVI-800, SubVI-1024, SubVI-Landscape, etc.

Robot wink
0 Kudos
Message 7 of 12
(12,976 Views)
Hi ibuddler,

But the problem now is we finished lv code and then we realized we needed to support down to 800*600 screen. So we need some support or software which can resize the front panel.

      Yes, stupid of me, only realized after posting that you really wanted to adapt to an arbitrary screen size.  In that case, the attached VI dynamically scales the position and Size of its front panel controls as the user resizes the window.  It could use some fine-tuning at right and bottom edges, but it's definately a proof-of-concept.
 
In your app, the resize would just need to happen once, on launching the app.
 


Message Edited by tbd on 01-19-2008 01:17 AM
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Download All
0 Kudos
Message 8 of 12
(12,960 Views)
You can find more generic example here (there's also one later in the thread), but you should note that the first requires a lot of work and that neither is supported. Also, both don't take font sizes into account.

___________________
Try to take over the world!
0 Kudos
Message 9 of 12
(12,919 Views)
Thank you all. Following is the reply from NI support.  I think the best way is to edit vi in low resolution.
 
One of the easiest ways to tackle varying screen resolutions is to design
the front panel to the lowest resolution that you expect it to run on. It
should then look acceptable on any screen larger than that.

However, you can get a bit more tricky by programmatically determining the
computer's screen resolution and then dynamically changing the size of your
front panel objects. Use an Application Property Node and select
Display>>All Monitors to return the current screen size. Then, according to
the screen size, you can size the control or indicator programmatically
using the Size property node for your front panel objects.

Ultimately, these issues have often been a result of font size issues.
Specifically, this can be a problem when two machines have different
desktop theme/font settings. If your objects are coming out in different
sizes on different computers, you can setup up LabVIEW to use the same font
on different systems by modifying the .INI file.
The easiest way is to do this: use Tools->Options->Fonts from the LabVIEW
GUI.  You can then set the system fonts to anything you want.  After you
have done this on one machine, open your INI file (it is in the same
directory as the LabVIEW executable) with any text editor and copy the
corresponding entries to another file.  Add these entries to the INI files
on any machines you want to lock to font.  You will probably run into
issues if you are supporting different platforms (Windows and Mac or Mac
and Linux, for example), since the fonts you want may not be available on
both platforms.  There are Windows fonts available for both Mac and Linux
platforms, so this can be somewhat ameliorated.

This is all I can think of, but that's not to say these are the only
solutions. You might check the Discussion Forums, as many of our LabVIEW
Champions have tackled similar issues and offer their expertise as well.
Here's just a few threads that I'd like to refer you to:

How to make the size of VI and controls unchanged irrespective of the
resolution?
http://forums.ni.com/ni/board/message?board.id=170&message.id=273613&requireLogin=False


How to program the front panel size to fit different monitor resolution?
http://forums.ni.com/ni/board/message?board.id=170&message.id=87160&requireLogin=False


I hope this discussion helps you along the way in your application
development. Please let me know if you have any further questions/comments
and I would be happy to discuss them with you.
Otherwise, it was a pleasure assisting you and thank you for choosing
National Instruments.

0 Kudos
Message 10 of 12
(12,794 Views)