GxBitmap.CreateFromStream

Fore Syntax

CreateFromStream(Stream: IIOStream);

Fore.NET Syntax

CreateFromStream(Stream: System.IO.Stream);

Parameters

Stream. The stream that contains a bitmap.

Description

The CreateFromStream constructor creates a new bitmap from the stream contents that is passed by the Stream parameter.

Fore Example

Function GetBmpFromStream(BmpStream: IIOStream): IGxBitmap;
Var
    Bmp: IGxBitmap;
Begin
    If BmpStream.Size <> 0 Then
        Bmp := New GxBitmap.CreateFromStream(BmpStream);
        Return Bmp;
    Else
        Return Null;
    End If;
End Function GetBmpFromStream;

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

Fore.NET Example

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

Function GetBmpFromStream(BmpStream: Stream): GxBitmap;
Var
    Bmp: GxBitmap;
Begin
    If BmpStream.Length <> 0 Then
        Bmp := New GxBitmapClass_2();
        Bmp.CreateFromStream(BmpStream);
        Return Bmp;
    Else
        Return Null;
    End If;
End Function;

This function returns the image obtained from the stream, which is specified as an input parameter.

See also:

GxBitmap