GxIcon.CreateFromFile

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.

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.

See also:

GxIcon