필터 지우기
필터 지우기

I have trouble changing matlab icon into an .exe! Help!! Please.

조회 수: 2 (최근 30일)
Luis Camilo
Luis Camilo 2015년 1월 18일
편집: Luis Camilo 2015년 1월 18일
Hello everyone; I used the tool "deploytool- R2013a" to compile my GUIs, to which I added the following line for change the icon or logo of matlab.
%% For example in all the GUIs
function TWF_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
jFrame=get(handle(gcf),'javaframe');
jIcon=javax.swing.ImageIcon('TWF.jpg');
jFrame.setFigureIcon(jIcon);
guidata(hObject, handles); end
After compiling the code, I run the .exe and the logo or icon of each GUI and my ".exe" is changed by the Java icon, I added all my images in the compilation folder, but it apparently not read the file path. Even, I read the image of icon with "imread" for change the cover of my executable and the code load file success, but the ".exe" doesn't with my icons or logos.
%% For example in the initial code.
function TunWaterFlow [cdata, map] = imread('TWF.jpg');
dlgTitle = 'TunWaterFlow V 1.0 - Jan 2015 - LCSC';
tagl = 'TunWaterFlow V 1.0 - Jan 2015 - LCSC';
dlg = dialog( 'Name', dlgTitle, ...
'Color', 'White', ...
'WindowStyle', 'Normal', ...
'Visible', 'off', ...
'Tag', tagl,...
'Colormap', map);
pos = get(dlg, 'position');
imsize = size(cdata);
pos(3) = imsize(2);
pos(4) = imsize(1);
dlgWidth = pos(3)-pos(3).*.5;
imH = pos(4)-pos(4)*.5;
set(dlg, 'Position', pos-pos*.10);
ax = axes( 'Parent', dlg, ...
'Visible', 'off', ...
'units', 'normal', ...
'position', [0 0 1 1], ...
'xlim', [0 imsize(2)], ...
'ydir', 'reverse', ...
'ylim', [0 imsize(1)]);
image('Parent', ax, 'CData', cdata);
%
jFrame=get(handle(dlg),'javaframe');
jIcon=javax.swing.ImageIcon('TWF.jpg');
jFrame.setFigureIcon(jIcon);
movegui(dlg,'center')
set(dlg, 'Visible', 'on');
end
If I paste the image, along with the .exe and I run the program again, this ."exe" load successfully. Let me know how I can make my executable keep this hidden image and then, it call all together with the compiled files? Thank You.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by