Dynamic Icons Scripting Reference - v1.3.0
    Preparing search index...

    Class DynamicImage

    This class hold an image source (file path or b64 string) and associated data like processing options and a transformation to apply.

    It makes use of a global image cache for storing & retrieving the actual images.

    The render() method will take care of any required scaling (according to the resizeOptions.fit property setting) and apply the transform, if needed.

    Implements

    • ILayerElement
    • IRenderable
    • IValuedElement
    Index

    Accessors

    • get isEmpty(): boolean

      Returns true if source string is empty

      Returns boolean

    Constructors

    Methods

    • Sets/updates the image source using an evaluated string.

      Parameters

      • value: string

      Returns void

    • Scales imgRect to size of intoRect based on fit strategy. Also centers imgRect if it is smaller than intoRect in either dimension.

      Modifies imgRect input, returns undefined.

      Parameters

      Returns void

    Properties

    source: string = ""

    Path to image file or a base-64 encoded string containing image data. Relative paths are resolved against default file path configured in plugin settings, if any.

    iconName: string = ""

    The icon name to which this image is assigned. This is required for image cache management.

    resizeOptions: { fit: ResizeFitOption } = ...

    Settings to determine how images are resized to fit into drawing area.

    Type declaration

    • fit: ResizeFitOption

      Defines how to resize image. Equivalent to the CSS object-fit property. One of: "contain", "cover", "fill", "scale-down", or "none"

    transform: Transformation

    Tranformation to apply to this image when drawn. See Transformation for details.