Table of Contents

Codeunit Image

ID 3971
Namespace: System.Utilities

Provides functionality for working with images.

Properties

Name Value
Access Public
InherentEntitlements X
InherentPermissions X

Methods

Clear

Clears the entire drawing surface and fills it with the specified background color.

procedure Clear(Alpha: Integer, Red: Integer, Green: Integer, Blue: Integer)

Parameters

Name Type Description
Alpha Integer

The alpha component. Valid values are 0 through 255.

Red Integer

The red component. Valid values are 0 through 255.

Green Integer

The green component. Valid values are 0 through 255.

Blue Integer

The blue component. Valid values are 0 through 255.

Clear

Clears the entire drawing surface and fills it with the specified background color.

procedure Clear(Red: Integer, Green: Integer, Blue: Integer)

Parameters

Name Type Description
Red Integer

The red component. Valid values are 0 through 255.

Green Integer

The green component. Valid values are 0 through 255.

Blue Integer

The blue component. Valid values are 0 through 255.

Crop

Crops the image based on a rectangle specified by the user. The resulting crop will be a hole-cut in the image made by the rectangle.

procedure Crop(X: Integer, Y: Integer, Width: Integer, Height: Integer)

Parameters

Name Type Description
X Integer

X coordinate of the rectangle.

Y Integer

Y coordinate of the rectangle.

Width Integer

Width of rectangle.

Height Integer

Height of the rectangle./

Remarks

The Rectangles top left corner has to be within the image dimensions, but specifying a width or height that makes the rectangle go outside the image dimensions is allowed. Anything outside the image dimensions will be filled with the image background color.

GetFormatAsText

Gets the image format as a text.

procedure GetFormatAsText(): Text

Returns

Type Description
Text

A text containing the format value.

GetFormat

Gets the image format as an Enum "Image Format".

procedure GetFormat(): Enum "Image Format"

Returns

Type Description
Enum System.Utilities."Image Format"

The enum value.

SetFormat

Sets the image format from an Enum "Image Format".

procedure SetFormat(ImageFormat: Enum "Image Format")

Parameters

Name Type Description
ImageFormat Enum System.Utilities."Image Format"

Remarks

Depending on the format selected, calling this method may result in loss of image quality.

FromBase64

Creates an Image from base64 encoding.

procedure FromBase64(Base64Text: Text)

Parameters

Name Type Description
Base64Text Text

A base64 encoded string the contains the image.

FromStream

Creates an image from the specified data stream.

procedure FromStream(InStream: InStream)

Parameters

Name Type Description
InStream InStream

A Stream that contains the image data.

GetWidth

Gets the width in pixels.

procedure GetWidth(): Integer

Returns

Type Description
Integer

The width in pixels.

GetHeight

Gets the height in pixels.

procedure GetHeight(): Integer

Returns

Type Description
Integer

The height in pixels.

Resize

Resizes the Image to the specified size.

procedure Resize(Width: Integer, Height: Integer)

Parameters

Name Type Description
Width Integer

The resize width.

Height Integer

The resize height.

RotateFlip

Rotates, flips, or rotates and flips the image.

procedure RotateFlip(RotateFlipType: Enum "Rotate Flip Type")

Parameters

Name Type Description
RotateFlipType Enum System.Utilities."Rotate Flip Type"

The type of rotation and flip.

Save

Saves the image to the specified stream in the specified format.

procedure Save(OutStream: OutStream)

Parameters

Name Type Description
OutStream OutStream

A Stream that will store the image data.

ToBase64

Convert the image to a base64 encoded string.

procedure ToBase64(): Text

Returns

Type Description
Text

A string containing the image data encoded with base64.

GetRotateFlipType

Gets the image rotation flip type.

procedure GetRotateFlipType(): Enum "Rotate Flip Type"

Returns

Type Description
Enum System.Utilities."Rotate Flip Type"

The type of rotation and flip of the image.

See also