How do I capture a Stateflow chart image into the clipboard without the beige background color and chart information string?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
Respuesta aceptada
MathWorks Support Team
el 27 de Jun. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Stateflow Charts en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!