Save specific portion of GUI screen

1 visualizzazione (ultimi 30 giorni)
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.

Risposta accettata

Walter Roberson
Walter Roberson il 23 Gen 2013
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);

Più risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by