How to replace MATLAB icon from a figure window?

57 ビュー (過去 30 日間)
Vieniava
Vieniava 2011 年 1 月 30 日
編集済み: Antony 2024 年 2 月 4 日
How to replace or delete the MATLAB icon (the peaks) from a figure window?
  1 件のコメント
Bruno Luong
Bruno Luong 2011 年 1 月 30 日
Replacing or altering figure icons violates Matlab license agreement.

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

採用された回答

Paulo Silva
Paulo Silva 2011 年 1 月 30 日
replace FIGUREHANDLE with your figure handle, test with gcf
replace PATH with the path, name and extension of the icon for example
C:\Program Files (x86)\MATLAB\R2008b\toolbox\systemtest\systemtest\icons\StopElement.gif
warning('off','MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame');
jframe=get(FIGUREHANDLE,'javaframe');
jIcon=javax.swing.ImageIcon('PATH');
jframe.setFigureIcon(jIcon);

その他の回答 (2 件)

Siddharth Shankar
Siddharth Shankar 2011 年 1 月 30 日
As Bruno says, that would be a breach of the MathWorks license agreement. Specific details here:
  4 件のコメント
Vieniava
Vieniava 2011 年 1 月 31 日
Siddarth, thanks for pointing out the reference to license agreement
Vieniava
Vieniava 2011 年 1 月 31 日
Jan Simon, thanks. I think this is too rigid, especially when someone has got commercial license for Matlab/Compiler and sells own software.

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


Antony
Antony 2024 年 2 月 4 日
編集済み: Antony 2024 年 2 月 4 日
This answer is pretty old and I've bumped into it a few times, so for the sake of new users,
here's how its done. (BTW, I'm assuming a UI figure).
fig = uifigure("WindowStyle","alwaysontop");
fig.Position = [500 500 1000 445];
pathToMLAPP = fileparts(mfilename('fullpath'));
fig.Icon = fullfile(pathToMLAPP, 'my_icon.png');

カテゴリ

Help Center および File ExchangeGraphics Objects についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by