AnnSetPoints example for C++ Builder
void TForm1::AnnSetPointsExample ( HANNOBJECT hObj, HANNOBJECT hObj2 )
{
L_UINT uArea;
ANNPOINT ptPoints[ 4 ];
// 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 \n"\
" Left: " + IntToStr(LEADAnn1->AnnBoundingRectLeft[hObj]) + "\n" +
" Top:" + IntToStr(LEADAnn1->AnnBoundingRectTop[hObj]) + "\n" +
" Width:" + IntToStr(LEADAnn1->AnnBoundingRectWidth[hObj]) + "\n" +
" 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" );
}