In MATLAB 6.0 (R12), why do my uicontrols print out with a black horizontal line around the edges?

1 view (last 30 days)
In MATLAB 6.0 (R12), why do my uicontrols print out with a black horizontal line around the edges?
h1 = figure(...
'color',get(0,'defaultuicontrolbackgroundcolor'),...
'Units','characters',...
'InvertHardcopy','off',...
'MenuBar','none',...
'Name','Untitled',...
'NumberTitle','off',...
'Position',[71.8000 39.4615 112.0000 32.3077],...
'Renderer','painters',...
'RendererMode','manual',...
'Tag','figure1');
h2 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[9.4000 27.2308 14.8000 1.6923],...
'String','Toggle Button',...
'Style','togglebutton',...
'Tag','togglebutton1');
h3 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[9.4000 22.9231 13.2000 1.6923],...
'String','Push Button',...
'Tag','pushbutton1');
h4 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[11.4000 16.2308 34.2000 4.0000],...
'String','Static Text',...
'Style','text',...
'Tag','text1');
h5 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[12.4000 10.5385 34.2000 4.0000],...
'String','Static Text',...
'Style','text',...
'Tag','text2');
h6 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[11.6000 5.6154 34.2000 4.0000],...
'String','Long string that may or may not wrap',...
'Style','text',...
'Tag','text3');
h7 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[61.6000 5.4615 34.2000 4.0000],...
'String','Static Text',...
'Style','text',...
'Tag','text4');
print test.jpg -djpeg

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
This issue has been reported to our development staff to be addressed in a future release of MATLAB.
One possible workaround is to capture an image of the GUI using GETFRAME and then print to an image file using IMWRITE. You can then print the GUI from another application. For example:
h = figure;
surf(peaks);
ui = uicontrol('Style', 'Pushbutton', 'String', 'Text');
[X,map] = getframe(h);
imwrite(X,map,'test.jpg');

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!