Skip to main content

Viewing Image Files

The following options are available for accessing an image from the HTML5 control.

Referencing

Description

Static image from JavaScript code referenced in Additional Files

The image is referenced in the HTML5 control editor, on the General tab, in the Additional Files field.

In the script code, the actual file name is retrieved by using the API “CDSWebVisuAccess.getAdditionalFile". Then the image can be integrated in the control instead.

Static image from JavaScript code with Data URI

This mechanism can be used to embed an image directly into the corresponding file.

Image which is managed in an image pool referenced with <image pool>.<image>

Reference from JavaScript code

Requirement: The HTML5 control provides one or more configurations for the Imageeditor type.

In the script code, the actual file name is retrieved by using the API "CDSWebVisuAccess.getImagePoolFileName".

The user can then assign the ID of an image from an image pool with <image pool>.<image> so that the HTML5 control can load the corresponding image from the web server.

Image referencing within a CSS style using Data URI

If an image should be embedded in a CSS style sheet, then this can be done using a Data URI.

Example:

/* using an incomplete URI to save space*/
p{
    background-image: url("data:image/png;base64,iVBORw0KGg...QmCC");
    background-repeat: repeat;
}