CreateFromStreamS(Stream: IIOStream; Size: IGxSize);
CreateFromStreamS(Stream: System.IO.Stream; Size: Prognoz.Platform.Interop.Drawing.GxSize);
Stream. Stream, from which the icon is loaded.
Size. The sizes, according to which the icon is scaled.
The CreateFromStreamS constructor creates an icon from the stream scaling it to the sizes specified in the Size sizes parameter.
Function GetScalingIconFromStream(IconStream: IIOStream; SWidth: Integer; SHeight: Integer): IGxIcon;
Var
ScalingSize: IGxSize;
OutIcon: IGxIcon;
Begin
If IconStream.Size <> 0 Then
ScalingSize := New GxSize.Create(SWidth, SHeight);
OutIcon := New GxIcon.CreateFromStreamS(IconStream, ScalingSize);
Return OutIcon;
Else
Return Null;
End If;
End Function GetScalingIconFromStream;
The function returns the icon obtained from the stream and scaled in accordance with the specified sizes.
Imports System.IO;
Imports Prognoz.Platform.Interop.Drawing;
Function GetScalingIconFromStream(IconStream: Stream; SWidth: Integer; SHeight: Integer): GxIcon;
Var
ScalingSize: GxSize;
OutIcon: GxIcon;
Begin
If IconStream.Length <> 0 Then
ScalingSize := New GxSizeClass();
ScalingSize.Create(SWidth, SHeight);
OutIcon := New GxIconClass();
OutIcon.CreateFromStreamS(IconStream, ScalingSize);
Return OutIcon;
Else
Return Null;
End If;
End Function;
The function returns the icon obtained from the stream and scaled in accordance with the specified sizes.
See also: