Main Content

Add Images in Masks

You can add images as icons on a Simulink® mask and save them along with the model.

  1. Select a masked block and on the Block tab, click Add Image.

  2. In the Add mask icon image dialog box, click Browse to select an image from your local repository.

    add images in mask

  3. Specify the position and size of the image within the block mask icon using Margin and Dimensions.

  4. Select Save a copy of the image with model to save the image with the model.

  5. Click Edit Icon to set the properties of the icon such as Opaque, Transparent, and Opaque with ports.

  6. Click OK to save your changes.

You can remove an icon from the masked block. Select the masked block and on the Block tab, click Remove Image.

Store Mask Images Programmatically

  • Convert mask image to internal for one block. Where block is the name of the block.

    Simulink.Mask.convertToInternalImage(block)
  • Convert mask image to internal for the whole model. Where modelName is the name of the model.

    Simulink.Mask.convertToInternalImages(modelName)
  • Convert mask image to external for one block. Where block is the name of the block.

    Simulink.Mask.convertToExternalImage(block)

Related Topics