MATLAB Answers

How do you enable a GUI to adjust to fit screens of varying resolution

조회 수: 175(최근 30일)
Cordelle
Cordelle 1 Jul 2013
I created a GUI in Guide and I want my GUI to adjust to fit screens of different varying resolution, because my application will be used on different computers.
Is there a way to allow this guide? If so, how?
or
Is there a few lines of code need to enable this feature? If so, where can i find examples of the code?
Thank you in advance,
Cordelle

  댓글 수: 0

로그인 to comment.

채택된 답변

Tom
Tom 1 Jul 2013
In GUIDE, under Tools -> GUI options you can specify the resizing of the figure, including your own resize function.
You might also want to consider this FEX Submission.

  댓글 수: 6

표시 이전 댓글 수: 3
Tom
Tom 1 Jul 2013
try running it in the command line - it will give you the screen size in pixels. Yes, or you can change them when the GUI loads, for example in the OpeingFcn:
set(findobj(handles.figure1),'Units','Normalized')
Cordelle
Cordelle 1 Jul 2013
Once im given the screen size, how can i use the info to allow my GUI to adjust to any screen itself?
Tom
Tom 1 Jul 2013
You can set the figure size to the screensize:
set(handles.figure1,'Units','Pixels','Position',get(0,'ScreenSize'))
And from there resize the objects of the GUI.

로그인 to comment.

More Answers (1)

Panu Pratumnopharat
Panu Pratumnopharat 1 Jan 2017
Walter Roberson 님이 편집함. 1 Jan 2017
GUI = figure('Color',[0.941 0.941 0.941],...
'Name','HAWTsimulator',...
'NumberTitle','off',...
'MenuBar','none',...
'Unit','normalized',...
'Position',[0 0 1 1],...
'outerposition',[0 0 1 1]);

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by