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!