AnnRotate example for Delphi
// This example is also for the following:
// 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.
procedure TForm1.TestClick (Sender: TObject);
var
MyCaption: String;
begin
MyCaption:= Test.Caption;
if ( MyCaption = 'Flip' ) then
begin
//Flip using the center of the bitmap, as the axis.
LEADAnn1.AnnFlip (True, LEADAnn1.BitmapHeight / 2, True);
Test.Caption:= 'Reverse';
Exit;
end;
if ( MyCaption = 'Reverse' ) then
begin
//Reverse using the center of the bitmap as the axis.
LEADAnn1.AnnReverse (True, LEADAnn1.BitmapWidth / 2, True);
Test.Caption:= 'Rotate';
Exit;
end;
if (MyCaption = 'Rotate') then
begin
//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';
Exit;
end;
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');
end;