GxBitmap.CreateFromFile

Fore Syntax

CreateFromFile(FileName: String);

Fore.NET Syntax

CreateFromFile(FileName: String);

Parameters

FileName. The path and the name of the file that contains the image.

Description

The CreateFromFile constructor creates a new bitmap from the file specified in the FileName parameter.

Fore Example

Function GetBmpFromFile(FileName: String): IGxBitmap;
Var
    Bmp: IGxBitmap;
Begin
    If File.Exists(FileName) Then
        Bmp := New GxBitmap.CreateFromFile(FileName);
        Return Bmp;
    Else
        Return Null;
    End If;
End Function GetBmpFromFile;

The function returns the image obtained from the file, path to which is specified as an input parameter.

Fore.NET Example

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

Function GetBmpFromFile(FileName: String): GxBitmap;
Var
    Bmp: GxBitmap;
Begin
    If File.Exists(FileName) Then
        Bmp := New GxBitmapClass_2();
        Bmp.CreateFromFile(FileName);
        Return Bmp;
    Else
        Return Null;
    End If;
End Function;

The function returns the image obtained from the file, path to which is specified as an input parameter.

See also:

GxBitmap