Main Content

setImage

Insert image into annotation

Description

setImage(annotation,source) inserts an image from the clipboard or an image file into an annotation.

example

Examples

collapse all

Add an annotation in the chart ch. Use the file myImageFile.png, which is located in the folder myfolder/annotation_images, as the image for the annotation.

annotation = Stateflow.Annotation(ch);
setImage(annotation, ...
    fullfile("myfolder","annotation_images","myImageFile.png"));

Input Arguments

collapse all

Annotation, specified as a Stateflow.Annotation object.

Source of the image, specified as a string scalar or character array that contains the full path and name of an image file. Alternatively, to insert an image from the clipboard, specify "clipboard".

To convert an image annotation to a text annotation, specify "".

Version History

Introduced in R2014a