Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter TenGraphic and Image Functions (continued)

ImageResizePixels Function

Overview

The ImageResizePixels function resizes an Image object based on a pixel value.

Syntax/Parameters

Syntax

int = ImageResizePixels ( handle hImage, [int size] | [int width, int height] );

Parameters

hImage

A handle to an Image Object.

size

An integer specifying size in pixels to enlarge or reduce the image. When a single parameter is used, the aspect ratio is maintained.

width height

Two integers specifying size in pixels to enlarge or reduce the image for width and height separately. When both are used, the aspect ratio is not maintained unless height and width change in the same ratio as compared to the original size.

Return Value

Returns an int value as ERROR_NONE or a formatted error code.

Remarks

The ImageResizePixels function operates in one of two ways: either the function is supplied a single size parameter or it is supplied both a width and a height parameter. In the first case, the function resizes the image based on the larger dimension of the image. For example, if the original image is 50 pixels by 100 pixels and a value of 300 is passed to the function, the resultant image will be 150 pixels by 300 pixels. The aspect ratio is maintained. If two sizing parameters are passed to the function, it will resize the image’s height and width accordingly, and it is up to the programmer to maintain the aspect ratio.

Note that resizing the image requires two chunks of memory: memory for the existing image and new memory for the new image. This can result in memory errors if the result plus the source is too large. Because of the nature of the operation the memory must be contiguous.

Related Functions

Platform Support

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

Legato IDE, Legato Basic