function deployprint
% DEPLOYPRINT Manage printing in a deployed application.
%
%   This function works around a bug in the MCR's implementation of 
% printing on Windows. Choosing "Print" from the File menu of a deployed
% application does not work, on Windows. 

if (ispc)
    % Get the location of the temp directory
    tfile = tempname;
    print('-djpeg', '-r300', tfile);
    tfile = [tfile '.jpg'];
    cmd = ['PrintImage.exe ' tfile ' -i -d &'];
    [s, w] = dos(cmd);
else
   printdlg(gcbf);
end

