Perspective - Image
Component Palette Icon:
Description
The Image component displays either vector or raster format images, such as a jpeg, gif, png, or svg. For examples see Images and Icons in Perspective.
When attempting to show images from the Image Management Tool on this component, you'll need to prefix /system/images/ to the path. For example:
/system/images/Builtin/icons/48/about.png
The Image component can also be used to show external images stored relative to the local file system on the client. The file path is similar to having your browser view a local document.
Properties
Most Properties have binding options. For more information on Bindings, see Types of Bindings in Perspective. This section only documents the Props Category of properties. The other Categories are described on the Perspective Component Properties page.
Name | Description | Property Type |
---|---|---|
source | The image source URL. It can be a URL to an image on the internet or Gateway, or even an embedded image. If you use images in the Image Management tool, simply copy their path for this source property, using the format /system/images/<imagepath> . For example, the Builtin/icons/16/about.png image path would be /system/images/Builtin/icons/16/about.pngAdditionally, the source can be set to a Base64 encoded image. | value: string |
altText | An alternate text for the image if the image cannot be displayed because of a slow connection, an error in the source attribute, if the user uses a screen reader, or some other reason. | value: string |
fit | Whether or not the image will size to fit. When in percent mode, the parameters are used to fit based on the percentage of the width and height. When in absolute mode, the image will fit the width and height sizes in pixels. | object |
tint | Enables you to tint the entire image a color. | object |
style | Sets a style for this component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. Classes are predefined styles in a project. | object |
Component Events
The Perspective Event Types Reference page describes all the possible component event types for Perspective components. Not all component events support each Perspective component. The Component Events and Actions page shows how to configure events and actions on a Perspective component. Component scripting is handled separately and can be accessed from the Component menubar or by right clicking on the component.
Examples
Example 1
Property | Value |
---|---|
props.source | /system/images/Builtin/Flow/Flow 7.png |
props.fit.mode | contain |
props.tint.enabled | true |
props.tint.color | #FFF00 |
position.width | 150 |
position.height | 115 |
Example 2
Property | Value | Style Category |
---|---|---|
props.source | https://inductiveautomation.com/static/images/logos/inductive-automation-logo.png | N/A |
props.style.borderStyle | solid | border |
props.style.borderWidth | 1px | border |