Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter TenGraphic and Image Functions (continued)

ImageLoad Function

Overview

The ImageLoad function will load a specified image file into an Image object and return a handle to the object.

Syntax/Parameters

Syntax

handle = ImageLoad ( string filename | handle hDataObject );

Parameters

filename

A string containing a fully qualified filename with path. The file extension determines the image type. If the extension is unknown, the function will examine the content of the file to determine the file type. Once the image is loaded, the file is closed. Or,

hDataObject

A handle to a Data Object will the appropriate data descriptor.

Return Value

Returns a handle to an Image object or NULL_HANDLE on failure. Use the GetLastError function to retrieve error information.

Remarks

The load function takes the incoming file or Data Object and loads it into a Device Independent Bitmap (DIB) form. The source file is not locked for reading or writing. Not all features of all image type are supported. The following base image types can be imported:

BMP Bitmap – Windows basic image format. No or low compression. No transparencies. Up to 32-bit color. Optional RLE compression.
DIB Device Independent Bitmap – Basic image format that normalizes colors to device. No or low compression. No transparencies. Up to 32-bit color. Optional RLE compression.
EXIF Exchangeable Image Format – Supports multiple compressions types, including lossless. Alpha-blending and multiple color spaces supported. Supports meta information.
GIF Graphics Interchange Format – Paletted image. Supports transparencies, multiple images within a single file, and unusual palette sizes (such as 7-bit colors).
JPEG Joint Photographic Experts Group – Supports multiple compression types, including lossless, but is typically a glossy compression. Alpha-blending and multiple color spaces supported. Numerous extensions supported.
PNG Portable Network Graphics – Supports compression, alpha blending, paletted or raw colors up to 16 bits per channel.
Meta Windows Meta Data – A combination vector, meta and DIB format. WMF, EMF and EMZ, 16-bit, enhanced 32-bit and compressed.

Unlike many other functions, the ImageLoad function can produce warnings along with a valid handle. Therefore, the last error code and message should always be checked after loading an image into a Legato Image object. For example, if a feature within an image is not supported, the image may still load but warnings will be provided. Writing back an image with warnings may result in lost information or image data. Use the GetLastErrorMessage function to retrieve warnings if available. Legato Image objects do not support alpha blending. All color spaces, such as CYMK, will be converted to RGB, and any color information higher than 32-bit will be downsampled to 32-bit.

Note that the ImageOpen function is the same as the ImageLoad function but it has been deprecated.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic