GUI screen resolution auto-resize

29 vues (au cours des 30 derniers jours)
Eric Gilkey
Eric Gilkey le 28 Juin 2016
Commenté : Trinh Nam le 18 Fév 2020
Is there a way to have a GUI in guide auto-adjust to fit current screen resolution, and/or can I hard-set the resolution of the interface at a specific value?
  1 commentaire
Trinh Nam
Trinh Nam le 18 Fév 2020
You can Right Click on Guide (Open Fig file), Left Click to "GUI Options", Choose "Proportional" of Resize behavior

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 28 Juin 2016
You can set the figure Units property to be Normalized, and set the Position property to be [0 0 1 1] if you want full screen. Or, if more appropriate, you can set the Units to Pixels or to 'cm' and use the appropriate values for Position.
  7 commentaires
Walter Roberson
Walter Roberson le 29 Juin 2016
True full screen requires operating-system specific calls. Using position [0 0 1 1] covers all of the area except title bars and docks and trays -- all of the area that the window manager normally gives programs. To go beyond that you need one of the utilities like Image Analyst posted or such as https://www.mathworks.com/matlabcentral/fileexchange/11112-fullscreen
I have to agree with Adam that just scaling everything usually ends up looking bad. It is also problematic when you get to screens with different aspect ratios.
What I ended up doing was writing a series of utilities to do programmatic layout.
(Unfortunately, I cannot release them as-is, for copyright reasons, and I never got around to re-writing them.)
Eric Gilkey
Eric Gilkey le 30 Juin 2016
Thanks for the answers everyone. Changing the unit type seems to do the trick well enough.

Connectez-vous pour commenter.

Plus de réponses (1)

Image Analyst
Image Analyst le 29 Juin 2016
You have to set all the 'units' properties of all the controls to 'normalized'. To do this, type control-a to select everything in the GUI, then set the units property to 'normalized'. This may/will not set the units of controls inside a groupbox panel so you may have to set those separately.
Then, in the OpeningFcn() of your GUI, call the attached MaximizeFigureWindow (if you're using Microsoft Windows) to maximize the window. This truly maximizes it, unlike setting the position property of the GUI. Setting the Position property always seems to leave the window slightly misaligned anyway - bottom left is never at 0,0 like it should be.
  2 commentaires
Eric Gilkey
Eric Gilkey le 30 Juin 2016
Thanks Image Analyst
Hamin Chang
Hamin Chang le 15 Août 2017
Thank you so much!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by