Search code examples
delphiimage-processingimagej

How can i close polyline object in Delphi?


I am using this code listed below:

 hobj:= ImageEnVect1.AddNewObject(iekPOLYLINE, Blob.BoundingBox, clGreen);
 ImageEnVect1.PolylineClosingMode:=iecmOnNearFinish;
 ImageEnVect1.SetObjPolylinePoints(hobj,PPList);

And I get these not connected polygons:

enter image description here

How can i connect last points and first points of these polygons?


Solution

  • From documentation http://www.imageen.com/help/ImageEn/TImageEnVect.PolylineClosingMode.html

    iecmAlways means it always closes.

    With iecmOnNearFinish it will close if the end position of the polyline is very close to the start.