OIMAGE.$resize()

Function group Execute on client Platform(s)
OIMAGE NO All

Syntax

OIMAGE.$resize(xImage, iWidth, iHeight, &xNewImage [,wParams=#NULL, &cErrorText])

Description

Resizes the image xImage to the dimensions supplied in iWidth by iHeight. Returns Boolean true and xNewImage for success, or false and cErrorText if an error occurs.

xImage and xNewImage are both binary variables. xImage must be a JPEG or PNG image. xNewImage has the same type as xImage. You can use the same binary variable for both parameters if you want to replace the original image.

iWidth and iHeight can both be greater than zero and less than or equal to 32000, meaning resize to exactly that size. Alternatively, only one of the new dimensions can be zero, meaning calculate the dimension with value zero using the aspect ratio of the input image.

wParams is an optional row variable of parameters. The following columns can be specified in wParams:

  1. sampler
    The sampling method to be used when resizing. Either kOIMAGEsamplerBilinear or kOIMAGEsamplerNearestNeighbour. Defaults to kOIMAGEsamplerBilinear if this column is not present, or if wParams is omitted.

  2. gray
    A Boolean that indicates if the new image is to be a grayscale image. Defaults to kFalse if this column is not present, or if wParams is omitted.

  3. quality
    If the input image type is JPEG this column contains the JPEG image quality (1 to 100) of the new image. Defaults to 80 if this column is not present, or if wParams is omitted.

cErrorText The error text returned from the function.