|
|
Save image in axes in a GUI
Hi,
I have a GUI with axes where I plot an image that I would like to save as jpg. I tried with the following command:
saveas(gca,'NameOfTheImage.jpg')
but instead of saving only the image in the axes or the entore image of the GUI, it saves just a part of the GUI.
The best would be to understand how to save the image plotted in the axes, but in case, saving correctly the image of the entire GUI would be fine as well.
Thank you in advance for any help.
Rossella
|
|
0
|
|
|
|
Reply
|
Rossella
|
12/11/2010 1:28:21 AM |
|
Rossella:
Posts like yours appear every day or several times a day. Please see
the FAQ and see if that helps:
http://matlab.wikia.com/wiki/FAQ#How_do_I_save_my_figure.2C_axes.2C_or_image.3F__I.27m_having_trouble_with_the_built_in_MATLAB_functions.
|
|
0
|
|
|
|
Reply
|
Tombo
|
12/13/2010 1:48:20 AM
|
|
"Rossella Blatt" <ella@saypeace.com> wrote in message <iduk3l$4s7$1@fred.mathworks.com>...
> Hi,
> I have a GUI with axes where I plot an image that I would like to save as jpg. I tried with the following command:
> saveas(gca,'NameOfTheImage.jpg')
> but instead of saving only the image in the axes or the entore image of the GUI, it saves just a part of the GUI.
> The best would be to understand how to save the image plotted in the axes, but in case, saving correctly the image of the entire GUI would be fine as well.
>
> Thank you in advance for any help.
> Rossella
You could capture the image using getframe and then create a jpg using imwrite.
|
|
0
|
|
|
|
Reply
|
matt
|
12/13/2010 2:05:05 AM
|
|
Thanks to both of you!
I solved the issue using getframe and imwrite as Matt suggested.
Anyway, the exchange file export_fig suggested by Tombo semms very useful and many times I had some issues with graphic when saving an image, so that function should solve them all.
Thanks a lot.
Rossella
"matt dash" <n.a@mail.com> wrote in message <ie3v0h$hmk$1@fred.mathworks.com>...
> "Rossella Blatt" <ella@saypeace.com> wrote in message <iduk3l$4s7$1@fred.mathworks.com>...
> > Hi,
> > I have a GUI with axes where I plot an image that I would like to save as jpg. I tried with the following command:
> > saveas(gca,'NameOfTheImage.jpg')
> > but instead of saving only the image in the axes or the entore image of the GUI, it saves just a part of the GUI.
> > The best would be to understand how to save the image plotted in the axes, but in case, saving correctly the image of the entire GUI would be fine as well.
> >
> > Thank you in advance for any help.
> > Rossella
>
> You could capture the image using getframe and then create a jpg using imwrite.
|
|
0
|
|
|
|
Reply
|
Rossella
|
12/13/2010 4:30:26 PM
|
|
|
3 Replies
2093 Views
(page loaded in 0.045 seconds)
|
|
|
|
|
|
|
|
|