Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter NineDialog Functions (continued) 

9.8 Image Resources

9.8.1 Introduction

Images can be added to a script application by direct reference or stored as resources. Such resources can be later displayed on dialog pages using button or static controls or used on menus and ribbons. The Resource Object can be used to load and manage such resources include the operating system handles. Resource objects can be held for the life of a script or can be loaded on demand an discarded when no loader needed. For controls, when an image is displayed, the Resource Object must be maintained while the image is displayed.

9.8.2 ICON and BITMAP Resource Structure

Icon and bitmap resources can be declared anywhere within the resource portion or portions of a script. Both types allow a file to be referenced or the image data to be provided as an embedded hexadecimal data:

name BITMAP "filename.bmp"

name ICON "filename.ico"

Or,

name BITMAP
{
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
. . .
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
}

name ICON
{
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
. . .
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
}

Or,

name BITMAP
begin compact
424D3E010000000000003E00000028000000400000002000000001000100000000000001000000... FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
end

name ICON
begin compact
424D3E010000000000003E00000028000000400000002000000001000100000000000001000000... FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
end

When a filename is referenced and the path is not qualified, the path will be qualified based on the path of the source script. The statements ‘begin’ and ‘end’ can be interchanged with ‘{’ and ‘}’.

Optionally, image data can be hex encoded directly into the resource stream. The data must be a byte-for-byte encoding of the binary data to hexadecimal. The first embedded mode requires the hexadecimal content to be surrounded with single quotes and each byte to have a space delimiter. Any number of bytes can be placed on a line but is usually 16 except for the last line which is 16 or less. This is the conventional resource format for Windows resource files.

The last example illustrates the ‘compact’ mode, removing the spaces and quotes to reduce file size. This mode is not accepted by third-party editors.

9.8.3 Functions