AnnSaveTag example for Visual Basic

Note: Also works with Access 95 and 97.

Note: This topic is for Document/Medical only.

'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

'This sample saves all objects in Wang TIFF tag, clears the rasterview control, and reloads the image.
Private Sub AnnSaveTag_Click()
Dim RasterIO As New LEADRasterIO
RasterAnn.AnnSaveTag RasterIO, True, False
RasterIO.Save LEADRasterView1.Raster, "c:\testwang.tif", FILE_CCITT_GROUP4, 1, 2, SAVE_OVERWRITE

'clear the LEAD raster view control
LEADRasterView1.Raster.Bitmap = 0

'Reload the image with the wang-compatible annotations
RasterIO.Load LEADRasterView1.Raster, "c:\testwang.tif", 0, 0, 1
RasterAnn.AnnLoad "c:\testwang.tif", 1
RasterAnn.AnnUserMode = ANN_USERMODE_DESIGN
End Sub