AnnRotate example for Visual Basic
Note: Also works with Access 95 and 97.
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.
'Please note the following:
'LEADRasterView1 refers to a LEADRasterView control
'Global declarations
Private WithEvents RasterAnn As LEADRasterAnnotation
Private RasterAnnToolbar As LEADRasterAnnToolBar
'In the Form_Load method:
Set RasterAnn = New LEADRasterAnnotation
Set RasterAnnToolbar = New LEADRasterAnnToolBar
RasterAnn.AnnParentRasterView = LEADRasterView1
Private Sub AnnRotate_Click()
Dim MyCaption As String
MyCaption = AnnRotate.Caption
Select Case MyCaption
Case "Flip"
'Flip using the center of the bitmap as the axis.
RasterAnn.AnnFlip True, LEADRasterView1.Raster.BitmapHeight / 2, True
AnnRotate.Caption = "Reverse"
Case "Reverse"
'Reverse using the center of the bitmap as the axis.
RasterAnn.AnnReverse True, LEADRasterView1.Raster.BitmapWidth / 2, True
AnnRotate.Caption = "Rotate"
Case "Rotate"
'Rotate 90 degrees using the center of the bitmap as the axis.
RasterAnn.AnnRotate True, LEADRasterView1.Raster.BitmapWidth / 2, LEADRasterView1.Raster.BitmapHeight / 2, 90, True
AnnRotate.Caption = "Flip"
Case Else
AnnRotate.Caption = "Flip"
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN
RasterAnn.ANNTOOL = ANN_TOOL_REDACT
MsgBox "Draw two objects, use the right mouse button to select all, then click the command button"
End Select
End Sub