How do I capture a Stateflow chart image into the clipboard without the beige background color and chart information string?
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
From a Stateflow chart, I click "File" -> "Print Current View" -> "To Clipboard". The image place in the clipboard has a beige background color. Is there a way to copy the chart without the beige background color?
Risposta accettata
MathWorks Support Team
il 27 Giu 2009
There are two ways to print a Stateflow chart without the beige background color.
Option 1, From the Stateflow UI
1. Select the "Edit" -> "Style" menu.
2. Click on the background of the example chart that will appear.
3. Choose white (or whatever color you want), and click OK to dismiss the color picker.
4. Click apply and the chart will turn white.
5. Now, you can print without the beige background.
Option 2, From the Stateflow API
First, get a handle to the chart. The following code will work for the simple case of one chart open, see Stateflow API documentation for full details.
myChart = find(sf, '-isa', 'Stateflow.Chart');
oldColor = get(myChart, 'ChartColor');
set(myChart, 'ChartColor', [1 1 1]); % RGB values for white
%%Now, print the chart
shh = get(0,'ShowHiddenHandles');
set(0,'ShowHiddenHandles','on');
open_system(myChart.Path)
print(gcf)
%%reset original state
close_system(myChart.Path)
set(0,'ShowHiddenHandles',shh);
set(myChart, 'ChartColor', oldColor);
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Stateflow Charts in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!