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 | Control | |
resource | Resource value |
Return value
Type | Description |
---|---|
Path |
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