TextPosition: WxTextPosition;
The TextPosition property determines the position of text relative to an image used as an object fill.
Executing the example requires that the repository contains a workspace with the IWSTYLE 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;
Style: IWxStyle;
Begin
// Get workspace for editing
Mb := MetabaseClass.Active;
Wsp := Mb.ItemById("IWSTYLE").Edit As IWxWorkspace;
Wsp.BeginUpdate;
Shape := Wsp.Shapes.Item(0);
Shape.Picture := New GxImage.CreateFromFile("C:\ConnectedCPs.gif");
Shape.Text := "Text";
Style := Shape.Style;
Style.TextFontBrushColor := GxColor.FromName("Red");
Style.TextPosition := WxTextPosition.Right;
Wsp.EndUpdate;
(Wsp As IMetabaseObject).Save;
End Sub UserProc;
After executing the example an image is used as shape fill and a shape contains text, aligned at the right relative to the image.
See also: