![]() |
[求助]如何保存axes中的图像
我有一个GUI界面,是对矩阵进行运算后,输出成jpg格式的图像,现在我的保存方法如下:
[filename,pathname] = uiputfile('*.jpg','图片保存为'); if isequal([filename,pathname],[0,0]) return % Otherwise construct the fullfilename and Check and load the file. else aa=strcat(pathname,filename); handles.axes1=image(surTem+surTem0706-273) %findobj(gcf,'Type','image') saveas(handles.axes1,aa); end 这代码能保存图像,但是保存的只是我的界面的一角,请那位大侠能指导一下,如何才能保存在axes中的图像?谢谢 |
set(newAxes,'Units','default','Position','default'); % 改变图象的大小,否则图象不能充满绘图区
|
貌似有近似这样的做法,语句可能有错,现在没matlab调试了。大概这样:axis(handles.axes1);i=getimage(gca);imwrite(I,'savepic.jpg'); :smile:
|
回复: [求助]如何保存axes中的图像
用这个函数保存图像
I = getframe(gcf) imwrite(I.cdata, 'myplot.jpg') |
所有时间均为北京时间。现在的时间是 11:08。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.