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 Constants.

Note:
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
For all colors properties, e.g. IELP_FillColor, IELP_FillColor2, IELP_BorderColor, IELP_LineColor, IELP_FontColor, IELP_LabelColor, you can specify -1 for a random color, or -2 for a random pastel color


Sample Output

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


Examples

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



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


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


// All layers have a random fill and border
ImageEnView1.LayerDefaults.Values[ IELP_BorderColor ] := '-2';
ImageEnView1.LayerDefaults.Values[ IELP_FillColor   ] := '-2';


See Also

DefaultLayerShape
DefaultLayerText
OnNewLayer
GetProperties
SetProperties