IWxStyle.PictureAutoSize

Syntax

PictureAutoSize: Boolean;

PictureAutoSize: boolean;

Description

The PictureAutoSize property fits size of a graphics primitive to the original image size. If the property is set to True, size is fitted, otherwise it is not.

The default property value is False.

Example

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 edit
    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.PictureAutoSize := True;
    (ws 
As IMetabaseObject).Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;

 
Public Shared Sub Main(Params: StartParams);
Var
    mb: Imetabase;
    ws: IWxWorkspace;
    Shape: IWxShape;
    style: IWxStyle;
    Img: GxImage;
    Color: GxColorClassClass = 
New GxColorClassClass();
Begin
    
// Get workspace for editing
    mb := Params.Metabase;
    ws := mb.ItemById[
"IWSTYLE"].Edit() As IWxWorkspace;
    Shape := ws.Shapes.Item[
0];
    Img := 
New GxImageClass_2();
    Img.CreateFromFile(
"C:\ConnectedCPs.gif");
    Shape.Picture := Img;
    Style := Shape.Style;

    
Style.PictureAutoSize := True;
    
// Save changes
    (ws As IMetabaseObject).Save();
End Sub;

After executing the example the size is fitted.

See below the example displaying objects before the property is set to True (left) and after the property is set to True (right):

See also:

IWxStyle