AnnRotate example for Visual Basic
Note: This topic is for Document/Medical only.
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.
Private Sub Test_Click()
Dim MyCaption As String
MyCaption = Test.Caption
Select Case MyCaption
Case "Flip"
'Flip using the center of the bitmap as the axis.
Lead1.AnnFlip True, Lead1.BitmapHeight / 2, True
Test.Caption = "Reverse"
Case "Reverse"
'Reverse using the center of the bitmap as the axis.
Lead1.AnnReverse True, Lead1.BitmapWidth / 2, True
Test.Caption = "Rotate"
Case "Rotate"
'Rotate 90 degrees using the center of the bitmap as the axis.
Lead1.AnnRotate True, Lead1.BitmapWidth / 2, Lead1.BitmapHeight / 2, 90, True
Test.Caption = "Flip"
Case Else
Test.Caption = "Flip"
Lead1.AnnUserMode = ANNUSERMODE_DESIGN
Lead1.AnnTool = ANNTOOL_REDACT
MsgBox "Draw two objects, use the right mouse button to select all, then click the command button"
End Select
End Sub