AnnRotate example for C++ Builder
// This example is also for:
// AnnFlip method
// AnnReverse method
//This example uses the AnnFlip, AnnReverse, and AnnRotate methods.
//To code this example, add a command button named Test to the example you created in Loading
//and Displaying an Image. For best results when you run the example,
//draw two objects in opposite corners, and use the right mouse button to select
//all annotation objects. The command button then lets you cycle through the AnnFlip, AnnReverse, and AnnRotate methods.
void __fastcall TForm1::TestClick(TObject *Sender)
{
AnsiString MyCaption;
MyCaption= Test->Caption;
if ( MyCaption == "Flip" )
{
//Flip using the center of the bitmap as the axis.
LEADAnn1->AnnFlip (True, LEADAnn1->BitmapHeight / 2, True);
Test->Caption= "Reverse";
return;
}
if ( MyCaption == "Reverse" )
{
//Reverse using the center of the bitmap as the axis.
LEADAnn1->AnnReverse (True, LEADAnn1->BitmapWidth / 2, True);
Test->Caption= "Rotate";
return;
}
if ( MyCaption == "Rotate" )
{
//Rotate 90 degrees using the center of the bitmap as the axis.
LEADAnn1->AnnRotate (True, LEADAnn1->BitmapWidth / 2, LEADAnn1->BitmapHeight / 2, 90, True);
Test->Caption= "Flip";
return;
}
Test->Caption= "Flip";
LEADAnn1->AnnUserMode = ANNUSERMODE_DESIGN;
LEADAnn1->AnnTool= ANNTOOL_REDACT;
ShowMessage ( "Draw two objects, use the right mouse button to select all, then click the command button" ) ;
}