GxTextureBrush.Create

Fore Syntax

Create(Image: IGxImage; [WrapMode: GxWrapMode = 0;] [BrushSize: IGxRectF = Null]);

Fore.NET Syntax

Create(Image: Prognoz.Platform.Interop.Drawing.GxImage; WrapMode: Prognoz.Platform.Interop.Drawing.GxWrapMode; BrushSize: Prognoz.Platform.Interop.Drawing.GxRectF);

Parameters

Image. Image that is used as texture.

WrapMode. Mode of texture overlay.

BrushSize. The rectangle that determines the part of the image that is used as a texture. The sizes of the current rectangle cannot exceed the sizes of the image in use. The bounding of the image part is implemented regarding the top left angle.

Description

The Create constructor creates a new texture brush in accordance with the specified parameters.

Fore Example

Function GetGxTextureBrush(FileName: String): IGxTextureBrush;
Var
    TextureBrush: IGxTextureBrush;
Begin
    If File.Exists(FileName) Then
        TextureBrush := New GxTextureBrush.Create(GxImage.FromFile(FileName));
        Return TextureBrush;
    Else
        Return Null;
    End If;
End Function GetGxTextureBrush;

This function returns the texture brush based on the image, the path to which is passed as an input parameter.

Fore.NET Example

Imports System.IO;
Imports Prognoz.Platform.Interop.Drawing;

Function GetGxTextureBrush(FileName: String): IGxTextureBrush;
Var
    GxImageCls: GxImageClass;
    TextureBrush: GxTextureBrush;
Begin
    If File.Exists(FileName) Then
        GxImageCls := New GxImageClassClass();
        TextureBrush := New GxTextureBrushClass();
        TextureBrush.Create(GxImageCls.FromFile(FileName), GxWrapMode.gwmTile, Null);
        Return TextureBrush;
    Else
        Return Null;
    End If;
End Function;

This function returns the texture brush based on the image, the path to which is passed as an input parameter.

See also:

GxTextureBrush