ISISAcquireMulti example for Visual Basic

'The following example prepares for scanning multiple images by setting tags and enabling the ISISPage event and then scans multiple images, using ISISAcquireMulti method.

Dim nMaxPages As Long
Dim nRet As Integer
    nMaxPages = 10

    LEADRasterISIS1.EnableMethodErrors = False
    LEADRasterISIS1.EnableISISEvent = True
    nRet = LEADRasterISIS1.ISISLoadDriver
    If (nRet = 0) Then
        LEADRasterISIS1.ISISSetTag TAG_SCANAHEAD, TAG_SCANAHEAD_YES
        LEADRasterISIS1.ISISGetTag TAG_MAXPAGES
         nMaxPages = LEADRasterISIS1.ISISTagValue
        LEADRasterISIS1.ISISSetTag TAG_SCANAHEAD_MAXPAGES, nMaxPages / 2
        LEADRasterISIS1.ISISSetTag TAG_COMPRESSION, TAG_COMPRESSION_G4
        nRet = LEADRasterISIS1.ISISAcquireMulti (hWnd, LEADRasterView1.Raster, "d:\temp\vbtest.tif", ISIS_SHOWUI, FILE_CCITT_GROUP4, True, ISIS_BITMAP_LIST_OVERWRITE)
        LEADRasterISIS1.ISISUnloadDriver
        If (nRet <> 0) Then
            If (nRet = ERROR_USER_ABORT) Then
                MsgBox "Acquire canceled, " & CStr(LEADRasterISIS1.PagesDiscarded) & " pages were aborted!"
            ElseIf nRet <> ERROR_ISIS_CANCEL Then
                MsgBox "Error " & CStr(nRet) & Chr(13) & "During ISIS Scan"
            End If
        Else
            MsgBox "Image(s) acquired to file(s)" & "d:\temp\vbtest.tif"
        End If
    End If


Private Sub LEADRasterISIS1_ISISPage (ByVal nPage As Long, ByVal pszFileName As String)
    Text1.Text = CStr(nPage)
    Text1.Refresh
    Text2.Text = pszFileName
    Text2.Refresh
    DoEvents
End Sub