GxImage.CreateFromStream

Fore Syntax

CreateFromStream(Stream: IIOStream);

Fore.NET Syntax

CreateFromStream(Stream: System.IO.Stream);

Parameters

Stream. The stream that contains the graphic image.

Description

The CreateFromStream constructor creates a new image from contents of the stream passed by the Stream parameter.

Fore Example

Function GetImageFromStream(ImgStream: IIOStream): IGxImage;
Var
    Img: IGxImage;
Begin
    If ImgStream.Size <> 0 Then
        Img := New GxImage.CreateFromStream(ImgStream);
        Return Img;
    Else
        Return Null;
    End If;
End Function GetImageFromStream;

The function returns the image obtained from the stream specified as an input parameter.

Fore.NET Example

Imports System.IO;
Imports Prognoz.Platform.Interop.Drawing;

Function GetImageFromStream(ImageStream: Stream): GxImage;
Var
    Img: GxImage;
Begin
    If ImageStream.Length <> 0 Then
        Img := New GxImageClass_2();
        Img.CreateFromStream(ImageStream);
        Return Img;
    Else
        Return Null;
    End If;
End Function;

The function returns the image obtained from the stream specified as an input parameter.

See also:

GxImage