필터 지우기
필터 지우기

how can i get and save my running gui snapshot with a pushbutton?

조회 수: 1 (최근 30일)
Rajneesh Sharma
Rajneesh Sharma 2015년 1월 21일
답변: Chris 2015년 1월 21일
help

답변 (1개)

Chris Barnhart
Chris Barnhart 2015년 1월 21일
1) Assuming the gui is 1 figure - can use saveas (Or possibly snapnow which I've never used.)
2) Create a callback function within the gui code to save the image. Something like.
function gui_save_callback(h_obj, data) saveas(h_obj, 'filename.png', 'png'); end
3) Create the button object on the gui. button_handle = uicontrol('style','pushbutton','position',[10 170 50 20], 'string','SAVE GUI','Callback',@gui_save_callback);
I added this uicontrol just after creating the gui figure.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by