Programmatically capturing screenshots of Simulink blocks and dialogs
58 ビュー (過去 30 日間)
表示 古いコメント
This is a shot in the dark, but does anyone know of a convenient built-in way to programmatically create screen captures of Simulink blocks and dialogs? This is for documentation purposes. We'd like to show an image of the block and the dialog in the documents but we don't want to manually screencap the block and dialog of upwards of a hundred blocks.
3 件のコメント
Matthias Liermann
2020 年 6 月 22 日
Hi Carl, I am trying to do the same. I would like to programmatically take a screenshot of blocks in a model. How were you able to get the position of the block on the screen to take a screenshot of? The command
get_param(gcb,'position')
only gets you the position of the block relative to a model window reference. However, I couldn't figure out how to get the origin of this model window reference on the screen.
採用された回答
Greg
2018 年 10 月 10 日
You can import java packages into MATLAB, one of them (java.awt.* ??) includes the ability to take screenshots. I'm assuming there's an open or edit equivalent to launch each block, then use the java to capture screen.
0 件のコメント
その他の回答 (2 件)
Fangjun Jiang
2018 年 8 月 1 日
You might want to try Simulink "Web View". In the Simulink model, click menu File, Export model to, Web...
A html document is created. You can browse the hierarchy of the model just like in Simulink. Block dialog is not shown but block parameters are shown whenever you click a block. This is great for documentation purpose.
Alternatively, try menu File, Print, to a PDF file.
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!