IWxShape.Picture

Syntax

Picture: IGxImage;

Description

The Picture property determines the image to be used as a shape fill.

Example

Executing the example requires that repository contains a workspace with the WSP identifier containing shape. It is also required to have the ConnectedCPs.gif image.

Add links to the Andy, Drawing, Metabase system assemblies.

Sub UserProc;
Var
    mb: Imetabase;
    wsp: IWxWorkspace;
    Shape: IWxShape;
Begin
    // Get workspace for editing
    mb := MetabaseClass.Active;
    wsp := mb.ItemById("WSP").Edit As IWxWorkspace;
    wsp.BeginUpdate;
    Shape := wsp.Shapes.Item(0);
    Shape.Picture := New GxImage.CreateFromFile("C:\ConnectedCPs.gif");
    Shape.Style.PictureStretch := True;
    Shape.TransparentColor := GxColor.FromName("Red");
    wsp.EndUpdate;
    // Save changes
    (wsp As IMetabaseObject).Save;
End Sub UserProc;

After executing the example an image, which will be stretched if the shape is resized, is used as a shape fill. Red color will be transparent in the image.

See also:

IWxShape | IWxShape.TransparentColor