Upload Image
Verb: loadImage
Uploads an image file or an internet image via a URL to a variable.
Syntax
loadImage --file(String) (Image)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--file | File | Required | Text | Full path of the image file or URL of the internet hosted image that should be uploaded. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Image | Image | Returns the loaded image assigned to a variable. |
Example
Example 1: A new image is loaded, based on an image file, and assigned to the "loadedImage" variable.
defVar --name loadedImage --type Image
// Download the image file to insert it in the "file" parameter.
loadImage --file "imageForLoading.png" loadedImage=value
Example 2: Upload a new image from the Internet in a variable of type "Image"
defVar --name loadedImage --type Image
loadImage --file "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRt0Wl8ennSek_VmhnCXgi-_lR9_fpt1XFjuwGKCl-EQ5CEXiq1&s" loadedImage=value
logMessage --message "${loadedImage}" --type "Info"
For the correct operation of the script above, it is necessary to download the image and insert it in the File parameter of the Upload Image command.
Remarks
The variable of type "Image" can be viewed and inspected through the global variables by running the script in debug mode.