resolveBasePath

[ Function ]

public static resolveBasePath (
    control: TcHmi.Controls.System.baseTcHmiControl,
    resource: Theme.Resource
): string;

Returns the appropriate base path for a resource value of a control (i.e. to the current control or project theme directory). This is necessary, for example, if the value contains a path (for example, the URL of an image).

This is important because a project may have been overwritten here.

Parameter

Name

Type

Description

control

TcHmi.Controls.System.baseTcHmiControl

Control

resource

TcHmi.Theme.Resource

Resource value

Return value

Type

Description

string

Path

resolveBasePath 1:

Available from version 1.10.1171.10

Sample - JavaScript

var themeValue = TcHmi.Theme.Resources.get(this, 'myThemedResource'); 
var basePath = TcHmi.Theme.Resources.resolveBasePath(this, themeValue);
var url = basePath;
url += 'myImage.png';
// use url for XmlHttpRequest or in a HTMLImage.src