AnnSetPoints example for Delphi
procedure TForm1.AnnSetPointsExample ( hObj: HANNOBJECT; hObj2: HANNOBJECT );
var
uArea: L_UINT;
ptPoints: Array [ 0..3 ] of ANNPOINT;
begin
// Assign values for x and y from 1 through 3
ptPoints[1].x:= 10;
ptPoints[1].y:= 20;
ptPoints[2].x:= 100;
ptPoints[2].y:= 200;
ptPoints[3].x:= 200;
ptPoints[3].y:= 100;
LEADAnn1.AnnSetPoints ( hObj, @ptPoints, 3 );
ptPoints[0].x:= 50;
ptPoints[0].y:= 220; // SetPoints starts at 0 because No. of points set to 4
LEADAnn1.AnnSetPoints ( hObj2, @ptPoints, 4 );
LEADAnn1.AnnSetFillMode ( hObj2, ANNFILLMODE_OPAQUE, False );
Form1.Caption:= 'Protractor Bounding Rectangle' + Chr(13) +
' Left: ' + IntToStr(LEADAnn1.AnnBoundingRectLeft[hObj]) + Chr(13) +
' Top:' + IntToStr(LEADAnn1.AnnBoundingRectTop[hObj]) + Chr(13) +
' Width:' + IntToStr(LEADAnn1.AnnBoundingRectWidth[hObj]) + Chr(13) +
' Height:' + IntToStr(LEADAnn1.AnnBoundingRectHeight[hObj]);
LEADAnn1.AnnBringToFront ( hObj2 );
ShowMessage ( 'Brought Polygon to front' );
LEADAnn1.AnnGetArea(hObj2, uArea);
Form1.Caption:= 'Polygon Area:' + IntToStr(uArea);
LEADAnn1.AnnSendToBack ( hObj2 );
ShowMessage ( 'Sent Polygon to back' );
end;