How can I change the title bar icon of my app?

126 visualizaciones (últimos 30 días)
Isaac Marín
Isaac Marín el 10 de En. de 2020
Comentada: Steve Zissou el 7 de Feb. de 2024
In license agreement it is said:
3.1. MATLAB Compiler
vi) You may not modify or remove any proprietary notices included with Programs or Program Components. However, you are permitted to remove the MathWorks logo icon within the figure title bar of your Application and replace it with a different icon.
But how can I do that? There is an option in the compiler to add an icon, but when the app is opened, the Mathworks logo is displayed.
I am using App Designer, so the javaframe option is not available.
  2 comentarios
Joris Lambrecht
Joris Lambrecht el 22 de Feb. de 2020
+1 for the importance of this. It seems the license agreement has changed and we are now allowed to change the icon, so a lot of older posts on this forum are no longer accurate. But like Isaac says, how!?
I also want to change the icon in the top left of figure AND the icon used on the Windows Taskbar so the compiled app doesn't show up in my group of open Matlab windows. I tried using a resource editor (ResourceHacker and ResourceTuner) to change the icons. The installer in the "for_redistribution" folder did not contain any Matlab icons, only the custom icon that can be added using the Application CompilerWith ResourceTuner. With Resource Tuner, however, I was able to replace all the Matlab icons in the .exe from "for_redistribution_files_only" folder with my custom icon. But when I ran the .exe it still shows the Matlab icon! I assume the icon is therefore coming from the MCR, and I think it would be against the license agreement to modify the MCR.
PierreC
PierreC el 7 de Mayo de 2020
+1 as well ... This is pretty annoying, especially when you'd want to use different icons for different app windows (in order to identify them quickly).

Iniciar sesión para comentar.

Respuesta aceptada

Cris LaPierre
Cris LaPierre el 29 de Nov. de 2020
Starting with R2020b, there is now an icon property. You can use it to "specify custom icons for UI figure windows and toolbar push and toggle tools". You can see more under "App Building" in the release notes for R2020b.
To specify a custom icon, set the Icon property value to an image file or an m-by-n-by-3 truecolor array. See here in the UIFigure Properties.

Más respuestas (3)

Ganesh Regoti
Ganesh Regoti el 14 de En. de 2020
  1 comentario
Isaac Marín
Isaac Marín el 14 de En. de 2020
The link doesn't have a solution for this problem, i'm using MATLAB compiler R2019b

Iniciar sesión para comentar.


Isaac Marín
Isaac Marín el 14 de Mayo de 2020
  2 comentarios
Ajay Kumar
Ajay Kumar el 14 de Mayo de 2020
Editada: Ajay Kumar el 14 de Mayo de 2020
The thread is too confusing. Did you find the exact answer? if yes whose answer is it?
Or by your conclusion, can we change the icon or not?
Isaac Marín
Isaac Marín el 14 de Mayo de 2020
Is the aswer referenced in the link, it uses a custom function called "getWebWindowOfUiFigure", and it works to change the icon.

Iniciar sesión para comentar.


Bereketab Gulai
Bereketab Gulai el 19 de Jun. de 2020
Here is the real solution R2019b and above:
hUIFig = uifigure; % allow this to load first (run it separately from the below code)
% Find the CEF window for the running app's figure: this idea
% comes from DesktopFigureService MALTAB internal class (courtesy)
cefWindowList = matlab.internal.webwindowmanager.instance.windowList;
url = matlab.ui.internal.FigureServices.getFigureURL(hUIFig);
[idx] = arrayfun(@(ww)strcmp(url,ww.URL), cefWindowList);
hWin = cefWindowList(idx);
hWin.Icon = which('your-icon.ico'); % must be ico file
  3 comentarios
Bereketab Gulai
Bereketab Gulai el 22 de Jun. de 2020
Even when the app is deployed you can use
which('myIcon.ico');
making sure that the icon is included in the resources list in the compiler.
  • I did not understand about the "Windows still clusters the App along with other Matlab 2019b windows, even when deployed. ". It would be good to see a picture or illustration, more description.
  • Do you mean the windows on the taskbar show under the other RUNNING MATLAB APPs? If so, probably there is no solution to this, probably MATLAB apps of the same version (R2019b...) probably have something in common while running, thus windows groups as so. You could post a question about that in case some experts have a solution.
Steve Zissou
Steve Zissou el 7 de Feb. de 2024
Using 2023b
I am using the Application Compiler APPS to build our application on both mac and windows. We now have a mixture of figure and uifigures for the different tools in the application. When the application is compiled, installed, and opened on macOS Ventura the uifigure figures have the matlab icon on the Docker bar instead of our icon (orange with squiggles). I had to implement the matlab.internal.webwindowmanager.instance.windowList code from this answer above to get the uifigure icons correct on the windows computer, but on mac it is still broken. I have tried using both .ico and icns images for the icon, with the same result.

Iniciar sesión para comentar.

Categorías

Más información sobre Develop uifigure-Based Apps en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by