1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
function [msg_succes] = impression(hObject,~)
[h_fenPrec, h_ppal] = recherche_handlesFenetres(hObject) ;
liste_couleurs = getappdata(h_ppal, 'liste_couleurs') ;
h_boutons = getappdata(h_fenPrec,'handles_boutons');
set(h_boutons,'Visible','off')
try
set(h_fenPrec, 'PaperType', 'A4', 'PaperOrientation', 'portrait',...
'PaperPositionMode', 'auto');
print(h_fenPrec,'-dbmp','image_print');
msg_succes = 'impression reussie';
h_fenetre_impr = figure('Units', 'centimeters','Position',[0 0 29.7 21],...
'Menubar','None');
h_axe_impr = axes('Units', 'centimeters','Position',[0.2 0.2 29.5 20.8]);
im = imread('image_print.bmp','bmp');
imshow(im,'Parent',h_axe_impr);
uicontrol('Parent', h_fenetre_impr, ...
'Style', 'Text', ...
'String', 'JOHNNY C EST LE MEILLEUR!', ...
'ForegroundColor', liste_couleurs.rouge, ...
'BackgroundColor', liste_couleurs.blanc, ...
'Fontsize', 18, ...
'Units', 'Centimeters', ...
'FontName', 'FixedWidth', ...
'Position', [10 18 10 1]); % lgr_fenPix/2-360 -> 280
set(h_fenetre_impr,'PaperOrientation','landscape','PaperPositionMode', 'auto');
printdlg(h_fenetre_impr);
close(h_fenetre_impr);
catch err
disp(err)
msg_succes = 'erreur mon lapin, recommence';
end
set(h_boutons,'visible','on')
%disp(msg_succes);
end |
Partager