after drawing polyline as attached image I would like to move one of the polyline point with text layer following to that point.
I created as below...
procedure TfmAnalyzer.ImageEnView2LayerNotify(Sender: TObject; layer: Integer;
event: TIELayerEvent);
var
i, cnt, idx : Integer;
pt : TPoint;
X,Y : Integer;
begin
if event = ielCreated then begin
with TIEPolylineLayer(ImageEnView2.CurrentLayer) do begin
cnt := PointCount;
for i := 0 to cnt - 1 do begin
X := GetPoint(i, iepbBitmap).X;
Y := GetPoint(i, iepbBitmap).Y;
ImageEnView2.LayersAdd(ielkText, X+30, Y, 300, 70);
TIETextLayer(ImageEnView2.CurrentLayer).Name := 'TXTL_' + IntToStr(i);
TIETextLayer(ImageEnView2.CurrentLayer).Text := IntToStr(i+1) + ': ' + IntToStr(X) + '/' + IntToStr(Y);
TIETextLayer(ImageEnView2.CurrentLayer).BorderColor := clBlack;
TIETextLayer(ImageEnView2.CurrentLayer).BorderWidth := 2;
TIETextLayer(ImageEnView2.CurrentLayer).FillColor := clWhite;
TIETextLayer(ImageEnView2.CurrentLayer).Alignment := iejCenter;
TIETextLayer(ImageEnView2.CurrentLayer).Layout := ielCenter;
TIETextLayer(ImageEnView2.CurrentLayer).Font.Size := 30;
end;
end;
ImageEnView2.Update();
POLY_DONE := True;
end;
end;
I tried with OnLayerNotify event, OnLayerNotifyEx, OnLayerMoveSize...but I get errors...
My code is ...
if (ImageEnView2.Layers[layer].Kind = ielkPolyline) and (event = ielMovedPoint) then begin
ShowMessage('point moved...');
cnt := TIEPolylineLayer(ImageEnView2.CurrentLayer).PointCount;
ShowMessage(IntToStr(cnt));
for i := 0 to cnt - 1 do begin
X := TIEPolylineLayer(ImageEnView2.CurrentLayer).GetPoint(i, iepbBitmap).X;
X := TIEPolylineLayer(ImageEnView2.CurrentLayer).GetPoint(i, iepbBitmap).Y;
idx := ImageEnView2.LayersNameToIndex('TXTL_' + IntToStr(i), False);
ImageEnView2.Layers[idx].PosX := X + 30;
ImageEnView2.Layers[idx].PosY := Y;
TIETextLayer(ImageEnView2.Layers[idx]).Text := IntToStr(i+1) + ': ' + IntToStr(X) + '/' + IntToStr(Y);
end;
ImageEnView2.Update();
end;
what am I wrong? what should I do?
Any idea will be happy...
thanks.