ImageEn, unit imageenview

TImageEnView.LayerDefaults

TImageEnView.LayerDefaults


Declaration


property LayerDefaults: TStringList;


Description


Specifies a list of properties that are assigned to all new layers.
The properties are a list of Name=Value pairs, with names from the TIELayer Property Consts.

Notes:
- These properties apply to layers created programmatically (e.g. using LayersAdd) and by the user (e.g. using mlCreateShapeLayers).
- The OnNewLayer event can also be used to apply default properties


Sample Output


IELP_BorderColor=clNone
IELP_BorderWidth=0
IELP_FillColor=clYellow
IELP_FillColor2=clRed
IELP_FillGradient=1
IELP_Rotate=0


Example


ImageEnView1.LayerDefaults.Clear();
ImageEnView1.LayerDefaults.Add( IELP_BorderColor +'=$008000FF' );
ImageEnView1.LayerDefaults.Add( IELP_BorderWidth +'=3' );
ImageEnView1.LayersAdd( 'C:\New Zealand.jpg' ); // Added image will have a pink border



// Allow the user to create, size and select red arrows
ImageEnView1.LayerDefaults.Clear();
ImageEnView1.LayerDefaults.Add( IELP_LineColor +'=clRed' );
ImageEnView1.LayerDefaults.Add( IELP_LineWidth +'=6' );
ImageEnView1.LayerDefaults.Add( IELP_LineShapeSize +'=20' );
ImageEnView1.LayerDefaults.Add( IELP_LineStartShape +'=1' );
ImageEnView1.LayerDefaults.Add( IELP_Rotate +'=235' );
ImageEnView1.MouseInteractLayers := [ mlCreateLineLayers, mlMoveLayers, mlResizeLayers ];

// Allow users to draw rulers (lines with measurement values)
With ImageEnView1.LayerDefaults do
begin
  Clear();
  Add( IELP_IsRuler + '=True' );
  Add( IELP_RulerUnits + '=' + IntToStr( ord( ieuCentimeters )));
  Add( IELP_LabelPosition + '=' + IntToStr( ord( ielpAutoAbove )));
  Add( IELP_LineStartShape + '=' + IntToStr( ord( ieesBar )));
  Add( IELP_LineEndShape + '=' + IntToStr( ord( ieesBar )));
  Add( IELP_LineWidth + '= 2' );
end;
IEGlobalSettings().MeasureDecimalPlaces := 1;
ImageEnView1.MouseInteractLayers := [ mlClickCreateLineLayers, mlEditLayerPoints ];


See Also


- DefaultLayerShape
- DefaultLayerText
- OnNewLayer
- GetProperties
- SetProperties