GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Ten — Graphic and Image Functions (continued)
Overview
The ImageResizePercent function resizes an Image object based on a percentage value.
Syntax/Parameters
Syntax
int = ImageResizePercent ( handle hImage, [int size] | [int width, int height] );
Parameters
hImage
A handle to an Image Object.
size
An integer specifying size as a percent to enlarge or reduce the image. When a single parameter is used, the aspect ratio is maintained.
width height
Two integers specifying size as a percent to enlarge or reduce the image for width and height separately. When both parameters are used, the aspect ratio is not maintained unless height and width percent are the same.
Return Value
Returns an int value as ERROR_NONE or a formatted error code.
Remarks
The ImageResizePercent 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 percentage supplied. For example, if the original image is 50 pixels by 100 pixels and a value of 50 is passed to the function, the resultant image will be 25 pixels by 50 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. Passing a value of 100 will cause the function to leave one or both dimensions as is.
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
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.