从 MATLAB GUI 中删除标题栏以实现全屏显示

发布于 2024-11-08 17:15:54 字数 192 浏览 3 评论 0原文

我创建了一个 MATLAB GUI,我想显示它以填充整个屏幕。目前,标题栏显示在最顶部。有没有办法隐藏这个标题栏?

我考虑使用 psychtoolbox 来实现此目的,它允许全屏显示,但这不允许包含标准 MATLAB GUI 元素,据我所知。

(如果它很重要的话,这是针对 OSX 的。在使 GUI 全屏显示之前,我显然会隐藏菜单栏。)

I have created a MATLAB GUI, which I would like to display so that it fills the whole screen. Currently, the titlebar is showing at the very top. Is there a way to hide this titlebar?

I considered using the psychtoolbox for this purpose, which allows for full screen displays, but this doesn't allow for standard MATLAB GUI elements to be included as I understand it.

(If it is of importance, this is for OSX. I would obviously hide the menubar before making the GUI fullscreen.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

二智少女猫性小仙女 2024-11-15 17:15:54

我不知道这是否适用于 OSX,但在 Windows 上我可以使用 此 MATLAB 中的 Java 代码新闻组线程 创建一个没有标题、边缘等的全屏窗口,并在中间显示图像。以下是我制作窗口的方法:

img = imread('peppers.png');  %# A sample image to display
jimg = im2java(img);
frame = javax.swing.JFrame;
frame.setUndecorated(true);
icon = javax.swing.ImageIcon(jimg);
label = javax.swing.JLabel(icon);
frame.getContentPane.add(label);
frame.pack;
screenSize = get(0,'ScreenSize');  %# Get the screen size from the root object
frame.setSize(screenSize(3),screenSize(4));
frame.setLocation(0,0);
frame.show;

您可以通过执行以下操作再次隐藏框架:

frame.hide;

不确定这通常如何显示典型的 MATLAB GUI。我得多玩玩它并找出答案。

I don't know if this will work for OSX, but on Windows I was able to use the Java code from this MATLAB newsgroup thread to create a full screen window with no title, edges, etc. and display an image in the middle. Here's how I made the window:

img = imread('peppers.png');  %# A sample image to display
jimg = im2java(img);
frame = javax.swing.JFrame;
frame.setUndecorated(true);
icon = javax.swing.ImageIcon(jimg);
label = javax.swing.JLabel(icon);
frame.getContentPane.add(label);
frame.pack;
screenSize = get(0,'ScreenSize');  %# Get the screen size from the root object
frame.setSize(screenSize(3),screenSize(4));
frame.setLocation(0,0);
frame.show;

And you can hide the frame again by doing this:

frame.hide;

Not sure how this would work in general for displaying a typical MATLAB GUI. I'll have to play around with it more and find out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文