Unofficial Content

This method is part of  Image Tools project

Motivation

Thumbnails are reduced-size versions of pictures, used to help in recognizing and organizing them.
 Some web designers produce thumbnails with HTML coding that makes the user's browser shrink the picture, rather than use a smaller copy of the image.
 In GeneXus yo can use this function to show a small image but with the original aspect ratio y grids, for example in a main grid in work with, also you can use it in reports when you dont want to change the aspect ratio of the image.

Syntax

GenerateThumbnail( ImageSourcePath, ImageTargetPath, TargetHeight, TargetWidth, BorderColor)

where:
ImageSourcePath
    Is the original image path (full or relative).
ImageTargetPath
    Is the image returned path.
TargetHeight
    Is the height or the new image.
TargetWidth
    Is the width or the new image.
BorderColor
    If the images scale between the original and new image are different, for manteing aspect ratio, this method will add horizontal or vertical borders. This color is a numeric and you can use the GeneXus RGB function to generate this color.

Example

ImageTools.GenerateThumbnail("320x240.jpg",”500x240.jpg",240,500,0)

Image_Tools_Thumb1.PNG

Generate

Image_Tools_Thumb2.PNG

Example on a Report

Image_Tools_ThumbInReport 

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant