Main Content

getSnapshotImage

Class: slreportgen.report.ScopeSnapshot
Namespace: slreportgen.report

Image snapshot of Simulink scope block

Since R2024b

Syntax

path = getSnapshotImage(reporter,rpt)

Description

path = getSnapshotImage(reporter,rpt) takes the snapshot of the scope specified by the slreportgen.report.ScopeSnapshot reporter, reporter, and the report, rpt, into which the scope snapshot is added. The method creates an image file and returns the path of that file. You can add the created image to specific locations of the report, such as on a title page. By changing the report layout and then adding this image, you can control the image layout.

Note

If you use this method, set the ScopeSnapshot Scaling property to "custom". If you use "auto" scaling, the image does not scale to fit on the page.

Input Arguments

expand all

Scope snapshot reporter, specified as slreportgen.report.ScopeSnapshot object. For example,

openExample("vdp");
sim("vdp");
rpt = slreportgen.report.Report;
reporter = slreportgen.report.ScopeSnapshot...
     ("vdp/Scope");
snapshotImage = getSnapshotImage(reporter,rpt)

Name of the report to which to add the snapshot, specified as a slreportgen.report.Report object.

Output Arguments

expand all

Location of snapshot image file, returned as a string. The location is a temporary folder that is deleted when the report is closed. To retain the folder, set the Debug property of slreportgen.report.Report.

Version History

Introduced in R2024b