PictureProportional: Boolean;
The PictureProportional property enables the user to lock aspect ratio of an image when resizing an object.
If the property is set to True, the aspect ratio is locked, if it is set to False, it is not. The property is set to False by default.
Executing the example requires that repository contains a workspace with the IWSTYLE 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;
ws: IWxWorkspace;
Shape: IWxShape;
style: IWxStyle;
Begin
// Get workspace for editing
mb := MetabaseClass.Active;
ws := mb.ItemById("IWSTYLE").Edit As IWxWorkspace;
Shape := ws.Shapes.Item(0);
Shape.Picture := GxImage.FromFile("C:\ConnectedCPs.gif");
Style := Shape.Style;
Style.PictureProportional := True;
(ws As IMetabaseObject).Save;
End Sub UserProc;
After executing the example image size is scaled with the aspect ratio locked when resizing an object.
See also: