ImageEn, unit imageenview |
|
TImageEnView.LayersCreatePolylineFromSelection
TImageEnView.LayersCreatePolylineFromSelection
Declaration
function LayersCreateFromSelection(idx: Integer = -1; ClosePolygon: Boolean = False): Integer;
Description
Converts the selection to a new
Polyline layer. E.g. if
MouseInteractGeneral is [miSelectCircle], and the user has selected a circular area, then
LayersCreatePolylineFromSelection will create a circular polyline (or polygon).
If there are multiple selection areas, then multiple layers will be added.
idx specifies the insertion index for the layer, or -1 to append.
If
ClosePolygon is true, then
PolylineClosed will be set to true for any created layers.
Returns the index of the new layer.
// Convert the current selection into a polygon
ImageEnView1.LayersCreatePolylineFromSelection( -1, True );
// Apply color to all layers created by LayersCreateFromSelection
oldLayers := ImageEnView1.LayersCount;
ImageEnView1.LayersCreatePolylineFromSelection(-1, True);
for I := oldLayers to ImageEnView1.LayersCount - 1 do
begin
TIEPolylineLayer( ImageEnView1.Layers[i] ).LineColor := clBlack;
TIEPolylineLayer( ImageEnView1.Layers[i] ).LineWidth := 2;
TIEPolylineLayer( ImageEnView1.Layers[i] ).FillColor := clRed;
end;
ImageEnView1.Update();