How do I capture a Stateflow chart image into the clipboard without the beige background color and chart information string?
7 次查看(过去 30 天)
显示 更早的评论
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?
采纳的回答
MathWorks Support Team
2009-6-27
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Stateflow Charts 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!