-1

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?

FishCoder
  • 53
  • 7
  • Last point equal to first point? – LU RD Jul 19 '16 at 10:55
  • They are not equal. – FishCoder Jul 19 '16 at 10:59
  • 5
    If you want them closed, first point coordinates must be equal to last point. – LU RD Jul 19 '16 at 11:05
  • Nice advice but i have more than 10 000 polygon like these. Your advice means adding more than 10 000 points, this decelerate algorithm. I am trying to find a feature of Delphi for this problem. – FishCoder Jul 19 '16 at 11:11
  • 1
    Have you read the documentation before asking the question? – RBA Jul 19 '16 at 11:16
  • 1
    @Kaan Your excuse to not set a last point equal to the first to close each polygon is ridiculously weak. (1) If you have 10k polygons, an extra 10k points is not bad. Looking at your sample polygons you already have hundreds of thousands of points - an extra 10k will not be a significant number more than you already have. (2) Whether you close the polygons or Delphi closes them doesn't matter - in both cases you **use the same number of closing points!*** – Disillusioned Jul 19 '16 at 14:00
  • Much thanks! I set last points equal to first points. – FishCoder Jul 20 '16 at 06:39

1 Answers1

2

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.

RBA
  • 11,762
  • 14
  • 72
  • 118
  • I read documantation and tried iecmAlways but it does not work. I guess, there is a specific problem but i could not find. Much thanks for your advices. – FishCoder Jul 19 '16 at 11:39