Main Content

setMaskImage

Apply mask image to component

Since R2023b

    Description

    setMaskImage(arch,Name=Value) applies mask image to the architecture arch of a Component block or Variant Component block in System Composer™.

    example

    Examples

    collapse all

    Create a model with a component called Component.

    model = systemcomposer.createModel("archModel");
    systemcomposer.openModel("archModel");
    arch = get(model,"Architecture");
    comp = addComponent(arch,"Component");

    Apply a mask image to the component in the Icons folder as image.png that appears transparent and is stored within the model.

    comp.Architecture.setMaskImage(FilePath="Icons/image.png",...
    IconTransparency="transparent",...
    IsInternalImage="on")

    Input Arguments

    collapse all

    Architecture, specified as a systemcomposer.arch.Architecture object.

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: comp.Architecture.setMaskImage(FilePath="Icons/image.png",IconTransparency="transparent",IsInternalImage="on")

    Relative path of mask image, specified as a character vector or string.

    Example: comp.Architecture.setMaskImage(FilePath="Icons/image.png")

    Data Types: char | string

    Transparency of mask image, specified as one of these options:

    • "opaque" — No transparency

    • "transparent" — Transparent parts of image in PNG format are shown as fully transparent

    • "opaque-with-ports" — No transparency with ports shown

    Example: comp.Architecture.setMaskImage(IconTransparency="transparent")

    Data Types: char | string

    Option to store image file natively in the model, specified as one of these options:

    • "on" — Image file is stored natively in the model

    • "off" — Image file is available on the path from which it is selected and not saved in the model

    Example: comp.Architecture.setMaskImage(IsInternalImage="on")

    Data Types: char | string

    More About

    collapse all

    Version History

    Introduced in R2023b