Picture: IGxImage;
The Picture property determines the image to be used as a shape fill.
Executing the example requires that the repository contains a workspace with the WSP identifier that contains a 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: