Image File Does Not Save in Ms Access Evaluation Version

Questions, comments and suggestions concerning VintaSoft Twain ActiveX.

Moderator: Alex

Post Reply
papic1972
Posts: 2
Joined: Fri Aug 26, 2011 8:02 am

Image File Does Not Save in Ms Access Evaluation Version

Post by papic1972 »

Hello!

I have downloaded the evaluation version of Active X & have trialled the Ms Access demo.
The image file (which is scanned in b&w) does not preview to Image1 and does not save to disk. Is there any reason for this?

This is the code:

Code: Select all

Private Sub VSTwain1_PostScan(ByVal flag As Long)
     If flag <> 0 Then
        If VSTwain1.ErrorCode <> 0 Then
            MsgBox VSTwain1.ErrorString
        End If
     Else
        Set Image1.Picture = VSTwain1.GetCurrentImage
        VSTwain1.TiffCompression = 10
        VSTwain1.SaveImage 0, "c:\test.tif"
     End If
  End Sub
and this piece of code on the Acquire button:

Code: Select all

Private Sub BAcquire_Click(Cancel As Integer)
    With VSTwain1
        .StartDevice
        If .SelectSource = 1 Then
            .AutoCleanBuffer = 1
            .MaxImages = 1
            .ShowUI = 0
            .Acquire
        End If
    End With
End Sub
Can anyone please help as I would like to purchase a licence & start using this product immediately?
papic1972
Posts: 2
Joined: Fri Aug 26, 2011 8:02 am

Re: Image File Does Not Save in Ms Access Evaluation Version

Post by papic1972 »

This works:

Code: Select all

If flag <> 0 Then
   If VSTwain1.ErrorCode <> 0 Then
      MsgBox VSTwain1.ErrorString
   End If
Else
   If flag <> 0 Then
      If VSTwain1.ErrorCode <> 0 Then
         MsgBox VSTwain1.ErrorString
      End If
   Else
      'Set Image1.Picture = VSTwain1.GetCurrentImage
      VSTwain1.TiffCompression = 10
      If (VSTwain1.SaveImage(0, "c:\test\test.tif") = 1) Then
         MsgBox VSTwain1.ErrorString
      End If
   End If
End If
Post Reply