CompactFile Example for Visual Basic

Example 1:

Public RasterIO As New LEADRasterIO
Private Sub TestCompactFileExample1()
   Dim nRet As Integer
   ' This example will compact all the pages in a TIFF file. It will create a new file called dstfile.tif
   nRet = RasterIO.CompactFile("srcfile.tif", "dstfile.tif", 0, 0, -1, SAVE_OVERWRITE, 0)
   If nRet <> 0 Then
      MsgBox "Error compacting file!"
   End If
End Sub

Example 2:

Public RasterIO As New LEADRasterIO
Private Sub TestCompactFileExample2()
   Dim nRet As Integer
   ' This example will compact all the pages in a TIFF file. It will append all the pages to an existing file called dstfile.tif
   nRet = RasterIO.CompactFile("srcfile.tif", "dstfile.tif", 0, 0, -1, SAVE_APPEND, -1)
   If nRet <> 0 Then
      MsgBox "Error compacting file!"
   End If
End Sub