This is currently available on iOS only, in GeneXus Tero beta version. Android support is coming soon.
This document is a draft and may change in the future.
Image manipulation is a quite common task in Smart Devices applications. Actions that are common include: resizing, scaling, rotating, cropping, flipping horizontally and vertically, etc.
To let you perform these actions on images, GeneXus adds some functions to the Image data type.
Read-only property. Returns the image's width in pixels.
&width = &image.ImageWidth
Read-only property. Returns the image's height in pixels.
&height = &image.ImageHeight
Read-only property. Returns the image's file size in bytes.
&fileSize = &image.FileSize
Returns a new image by resizing the original image.
- width: Numeric, the width of the new image,
- height: Numeric, the height of the new image,
- keepAspect: Boolean, if set to True the image is resized using "fill keeping aspect", otherwise it uses "fill".
&resizedImage = &image.Resize(100, 100, true)
Returns a new image by scaling the original image by the specified percentage.
&scaledImage = &image.Scale(80)
Returns a new image by rotating the original image by the specified angle. Valid angles are: 90, 180 and 270; other values are ignored.
&rotatedImage = &image.Rotate(90)
Returns a new image by cropping the original image. The dimensions of the new image are determined from the square indicated by the parameters
- left: Numeric, the left coordinate in pixels where the cropping begins,
- top: Numeric, the top coordinate in pixels where the cropping begins,
- width: Numeric, the width of the new image in pixels,
- height: Numeric, the height of the new image in pixels.
&croppedImage = &image.Crop(0, 0, 50, 50)
Flips the image horizontally.
&hFlippedImage = &image.FlipHorizontally()
Flips the image vertically.
&vFlippedImage = &image.FlipVertically()