Save specific portion of GUI screen

조회 수: 1 (최근 30일)
fichtorious
fichtorious 2013년 1월 23일
Hi All,
I have a GUI screen that I created with GUIDE. It has two axes plots, some static text fields, buttons and check boxes. I want to save a specific portion of the screen when I hit the save button without printing the buttons or check boxes. I tried:
print(gcf,'-noui','-djpeg',fileName);
but this leaves out the static text fields on the save/print. I was wondering if anyone had any solutions to this. I'd be open to trying anything.

채택된 답변

Walter Roberson
Walter Roberson 2013년 1월 23일
ctl = findall(gcf, 'type', 'uicontrol', '-regexp', 'Style', 'checkbox|pushbutton');
ctl_state = get(ctl, 'Visible');
set(ctl, 'Visible', 'off');
print(gcf, '-djpeg', fileName);
set(ctl, 'Visible', ctl_state);

추가 답변 (0개)

카테고리

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