While working in GUI, how I can work with full screen?

5 ビュー (過去 30 日間)
sermet
sermet 2013 年 6 月 14 日
コメント済み: Image Analyst 2023 年 1 月 16 日
In GUI, fig window not opens full screen because of buttons, after completing my working I open fig file full screen and there are empty spaces occurs, how can I work full screen like fig file opens full screen in order to avoid spaces?
  1 件のコメント
David Sanchez
David Sanchez 2013 年 6 月 14 日
Could you state your question in another way? It is not very clear what your problem is. What spaces do you want to avoid?

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2013 年 6 月 14 日
The window managers generally do not allow windows to be sized as full screen unless special graphics calls are made. But you can try this FEX contribution for hints, or this one

その他の回答 (4 件)

Image Analyst
Image Analyst 2023 年 1 月 16 日
編集済み: Adam Danz 2023 年 1 月 16 日
In modern versions of MATLAB (R2018a or later) you can get the handle to your figure then set the WindowState property to 'maximized'.
hFig = figure;
hFig.WindowState = 'maximized'; % Maximize the window
hFig.NumberTitle = "off"; % Turn off "Fig 1" etc.
hFig.Name = 'My Awesome App'; % Whatever you want the title bar to say.
hFig.ToolBar = "none" % Turn off toolbar
hFig.MenuBar = "none" % Turn off pull down menu.
Or you can specify it all at once when you call the figure function:
hFig = figure('WindowState', 'maximized',... % Maximize the window
'NumberTitle', "off",... % Turn off "Fig 1" etc.
'Name', 'My Awesome App', ... % Whatever you want the titlebar to say.
'ToolBar', "none", ... % Turn off toolbar
'MenuBar', "none") % Turn off pull down menu.

Vishal Rane
Vishal Rane 2013 年 6 月 14 日
You could set the 'Units' to 'Normalized' ensuring that when you expand the figure, all components on ur GUI resize accordingly. For that your 'position' indices should be between 0 and 1.
  2 件のコメント
Walter Roberson
Walter Roberson 2013 年 6 月 14 日
The window managers for MS Windows do not normally permit applications to go completely full screen: they require that some space be left to access menu bars or close buttons or the like. You need to do special things to take over the entire screen.
Image Analyst
Image Analyst 2023 年 1 月 16 日
@Walter Roberson, you can now use the 'fullscreen' option for WindowState (as you probably know):
hFig = figure;
hFig.WindowState = "fullscreen"; % full Screen - no border anywhere
hFig.NumberTitle = "off"; % Turn off "Fig 1" etc.
hFig.Name = 'My Awesome App'; % Whatever you want the title bar to say.
hFig.ToolBar = "none" % Turn off toolbar
hFig.MenuBar = "none" % Turn off pull down menu.
% Now create an axes and plot stuff into it.
plot(1:10, 'b.');
grid on;

サインインしてコメントする。


Image Analyst
Image Analyst 2013 年 6 月 14 日
You can try this:
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
It makes it the same size as the full screen though it seems the upper left of the GUI is not always exactly, precisely at the upper left pixel of your video adapter.
  3 件のコメント
Nizam
Nizam 2016 年 1 月 15 日
If you're using GUIDE, paste the above code inside the Resize function (right click the layout editor>View Callback>ResizeFcn). Something similar to this:--> function figure1_ResizeFcn(hObject, eventdata, handles)....end
Image Analyst
Image Analyst 2016 年 1 月 15 日
A programmatic way to maximize the window is the attached code I got from Yair Altman It works both with R2014b and later (unlike some), and earlier.

サインインしてコメントする。


Jan
Jan 2013 年 6 月 18 日
FEX: WindowAPI allows to resize the figure to full screen (as the maximization button with visible task bar), to the full screen overlapping the task bar, and even to expand the inner position to both kinds of full screen.
  3 件のコメント
Image Analyst
Image Analyst 2023 年 1 月 16 日
@cr, As shown in my answer below, in modern versions of MATLAB you can get the handle to your figure then set the WindowState property to 'maximized'.
hFig = figure;
hFig.WindowState = 'maximized'; % Maximize the window
hFig.NumberTitle = "off"; % Turn off "Fig 1" etc.
hFig.Name = 'My Awesome App'; % Whatever you want the title bar to say.
hFig.ToolBar = "none" % Turn off toolbar
hFig.MenuBar = "none" % Turn off pull down menu.
Or you can specify it all at once when you call the figure function:
hFig = figure('WindowState', 'maximized',... % Maximize the window
'NumberTitle', "off",... % Turn off "Fig 1" etc.
'Name', 'My Awesome App', ... % Whatever you want the titlebar to say.
'ToolBar', "none", ... % Turn off toolbar
'MenuBar', "none") % Turn off pull down menu.
cr
cr 2023 年 1 月 16 日
Thanks. I see that latest version even has a fullscreen option. A reason to upgrade.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by