IGxImageClass.FromStream

Syntax

FromStream(Stream: IIOStream): IGxImage;

Parameters

Stream. The stream that contains the image.

Description

The FromStream method returns the image obtained from the stream.

Example

Executing the example requires a form that contains a button and the ImageBox component named ImageBox1. The repository contains a document with the TestImg 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