GxIcon.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 icon.

Description

The CreateFromFile constructor creates an icon from the specified file.

Fore Example

Function GetIconFromFile(FileName: String): IGxIcon;
Var
    OutIcon: IGxIcon;
Begin
    If File.Exists(FileName) Then
        OutIcon := New GxIcon.CreateFromFile(FileName);
        Return OutIcon;
    Else
        Return Null;
    End If;
End Function GetIconFromFile;

The function returns the icon 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 GetIconFromFile(FileName: String): GxIcon;
Var
    OutIcon: GxIcon;
Begin
    If File.Exists(FileName) Then
        OutIcon := New GxIconClass();
        OutIcon.CreateFromFile(FileName);
        Return OutIcon;
    Else
        Return Null;
    End If;
End Function;

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

See also:

GxIcon