ImageEn, unit imageenview

TImageEnView.LayersSetProperties

TImageEnView.LayersSetProperties


Declaration


procedure LayersSetProperties(LayerIndex: integer; Props: TStrings); overload;
procedure LayersSetProperties(LayerIndex: integer; const PropName, Value: Variant); overload;


Description


Sets properties of multiple layers in a batch (by calling SetProperties), including all or just selected layers.
Parameter Description
LayerIndex Index of the layer to update. Generally this will be LYR_SELECTED_LAYERS or LYR_ALL_LAYERS
Props A list of properties in Name=Value pairs
PropName A property to update
Value New value for the property


Names will be drawn from the TIELayer Property Consts. Properties can be retrieved using GetProperties.


Example


// Rotate all layers 45 degrees
ImageEnView1.LayersSetProperties( LYR_ALL_LAYERS, IELP_Rotate, 45 );

// Set the text for all text layers (other layer types will be ignored)
ImageEnView1.LayersSetProperties( LYR_ALL_LAYERS, IELP_Text, 'Double-click to edit text' );

// Set style properties for selected layers
ss := TStringList.Create;
ss.Add( 'IELP_BorderColor=clNone' );
ss.Add( 'IELP_BorderWidth=0' );
ss.Add( 'IELP_FillColor=clYellow' );
ss.Add( 'IELP_FillColor2=clRed' );
ss.Add( 'IELP_FillGradient=1' );
LayersSetProperties( LYR_SELECTED_LAYERS, ss );
ss.Free;

// Update all layers to use the default measurement (i.e. after a change)
ImageEnView1.LayersSetProperties( LYR_ALL_LAYERS, IELP_RulerUnits, IntToStr( ord( IEGlobalSettings().DefaultMeasureUnit )));


See Also


- SetProperties
- GetProperties