Print an image in Matlab GUI
Ältere Kommentare anzeigen
How do you print an image from a printer in Matlab GUI? I get an error using the code below. Please help me.
Undefined function or variable 'smapleimage'.
smapleimage = imread('image.png');
printdlg(handles.smapleimage)
Antworten (1)
Arthur
am 17 Nov. 2012
I guess it should be
smapleimage = imread('image.png');
printdlg(smapleimage)
6 Kommentare
Eric Letsolo
am 17 Nov. 2012
Arthur
am 17 Nov. 2012
This error does not come from the two lines you showed here. Please show the entire error message, and the code where it came from.
Eric Letsolo
am 17 Nov. 2012
Bearbeitet: Image Analyst
am 18 Nov. 2012
Arthur
am 17 Nov. 2012
Ok, printdlg only accepts figure windows. Try this:
hFig = figure();
smapleimage = imread('image.png');
imshow(smapleimage)
printdlg(hFig)
Eric Letsolo
am 17 Nov. 2012
Arthur
am 18 Nov. 2012
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!