CreateFromFileS(FileName: String; Size: IGxSize);
FileName. Path and the name of the file that contains the icon.
Size. The sizes, according to which the icon is scaled.
The CreateFromFileS constructor creates an icon from the specified file scaling it to the sizes specified in the Size sizes parameter.
Function GetScalingIconFromFile(FileName: String; SWidth: Integer; SHeight: Integer): IGxIcon;
Var
ScalingSize: IGxSize;
OutIcon: IGxIcon;
Begin
If File.Exists(FileName) Then
ScalingSize := New GxSize.Create(SWidth, SHeight);
OutIcon := New GxIcon.CreateFromFileS(FileName, ScalingSize);
Return OutIcon;
Else
Return Null;
End If;
End Function GetScalingIconFromFile;
This function returns the icon obtained from the file and scaled in accordance with the specified sizes.
See also: