Hi,
I have another problem, this time generating labels for polyline shapes. Labels work for point shapes but not for polyline. I’ve checked that I have the same number of shapes as I do entries in the .dbf file and looking at the data in the dbf it looks okay. Anybody encountered this before or have a solution?
Thanks
This is what I’m using to generate the polyline labels:
shape->Labels->FontSize = 7;
shape->Labels->FontBold = 1;
shape->Labels->LineOrientation = tkLineLabelOrientation::lorHorizontal;
shape->Labels->set_FrameType(tkLabelFrameType::lfPointedRectangle);
shape->Labels->FrameVisible = true;
shape->Labels->Generate(L"[Name]" ,tkLabelPositioning::lpCentroid,false);
shape->Labels->Visible = true;
As I said, it works for point shapes but not polylines.
Thanks
Trevor
Hi, I have the same problem. I have a polyline the represets a open polygon (not closed) and when I call Centroid function I get a error. Here is my code:
for i:=0 to shp.NumShapes-1 do begin
xlbl := shp.Shape[i].Centroid.x ; '<-- error
ylbl := shp.Shape[i].Centroid.y ;
lbltext := shp.CellValue[fieldIndex, i];
lblShp.AddLabel(lbltext, xlbl, ylbl, 0, 0 ,0,0); //cat red
end;