MATLAB: How to export a figure with its UI elements in Windows 7

figurematlab gui

Hi all,
I'm trying to export a Matlab figure together with its UI elements (the whole figure window). The usual way I export a figure as an eps vector image is something like this:
FigHandle = figure;
plot(rand(1,10));
set(FigHandle, 'PaperPositionMode', 'auto')
print(FigHandle, '-depsc2', '-painters', 'temp_fig.eps');
Is there a quick way of exporting the entire figure window?
Thanks!

Best Answer

But there are no uicontrol's in your example. Perhaps you mean the window border, the menubar and toolbar also? But then a direct export to an EPS file is not possible.
When I add uicontrol('String', 'hello'), it appears immediately in the exported EPS on my Matlab R2009a/64/Win7.
[EDITED] You can use FEX: ScreenCapture for the get(FigHandle, 'OuterPosition') to capture the window border also.
Related Question