MATLAB Answers

Print an image in Matlab GUI

13 views (last 30 days)
Eric Letsolo
Eric Letsolo on 17 Nov 2012
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)

  0 Comments

Sign in to comment.

Answers (1)

Arthur
Arthur on 17 Nov 2012
I guess it should be
smapleimage = imread('image.png');
printdlg(smapleimage)

  6 Comments

Show 3 older comments
Arthur
Arthur on 17 Nov 2012
Ok, printdlg only accepts figure windows. Try this:
hFig = figure();
smapleimage = imread('image.png');
imshow(smapleimage)
printdlg(hFig)
Eric Letsolo
Eric Letsolo on 17 Nov 2012
I can print a figure using printdlg(handles.Fig) Is it possible to print out an image from Matlab GUI

Sign in to comment.

Sign in to answer this question.


Translated by