GxIcon.CreateFromStreamS

Fore Syntax

CreateFromStreamS(Stream: IIOStream; Size: IGxSize);

Fore Syntax

CreateFromStreamS(Stream: System.IO.Stream; Size: Prognoz.Platform.Interop.Drawing.GxSize);

Parameters

Stream. Stream, from which the icon is loaded.

Size. The sizes, according to which the icon is scaled.

Description

The CreateFromStreamS constructor creates an icon from the stream scaling it to the sizes specified in the Size sizes parameter.

Fore Example

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.

Fore.NET Example

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:

GxIcon