Skip to content

ImageView

The ImageView control is used to display images.
The ImageView inherits all the methods and properties from the base class View.

Constructor:

  • constructor(parent: View)
    Creates an instance of ImageView control.
    • parent: the View containing the control itself.

Properties:

  • imageKind: ImageKind
    Defines the type of the image source. The ImageKind type helps specify whether the image comes from a file path, URL, base64 string, binary data, or icon. Possible values are:
    • ImageKind.Binary
    • ImageKind.Base64
    • ImageKind.File
    • ImageKind.Url
    • ImageKind.Icon
  • source: any
    The source of the image to be displayed. The content of the source depends on the imageKind. For instance, it could be a URL string, file path, a binary data array, a base64-encoded string, or an icon.
  • proportional: boolean
    Indicates whether the image should be scaled proportionally to fit the view without distorting the aspect ratio. Default is false.
  • stretch: boolean
    Controls whether the image should stretch to fill the entire view, potentially distorting the image’s aspect ratio. Default is false.
  • transparent: boolean
    Determines whether the image background should be transparent (if supported by the image format, such as PNG). Default is false.