IGxImageClass.FromStream

Syntax

FromStream(Stream: IIOStream): IGxImage;

Parameters

Stream - stream that contains the image.

Description

The FromStream method returns an object that contains the image obtained from the stream. The stream is passed by the Stream parameter.

Example

Executing the example requires a form that contains the button and the ImageBox component named ImageBox1. The repository contains a document with the TestImage identifier, to which a graphic image is loaded.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        MB: iMetabase;
        Doc: IDocument;
        Img: IGxImage;
    Begin
        MB := MetabaseClass.Active;
        Doc := MB.ItemById("TestImg").Bind As IDocument;
        Img := GxImage.FromStream(Doc.GetAsStream);
        Img.RotateFlip(GxRotateFlipType.Rotate90FlipNone);
        ImageBox1.Image := Img;
    End Sub Button1OnClick;

Clicking the button creates a new image based on the image from the specified document. The obtained image is rotated 90 degrees clockwise and loaded to the ImageBox1 component.

See also:

IGxImageClass