eztwain class

lothos12345

Junior Contributor
Joined
May 2, 2002
Location
Texas
I have created a Visual basic.net application that uses a visioneer 9650 usb scanner. I am using an eztwain class given to me by the supplier to interface this scanner with my application. My problem is when I scan an image in that has been faxed to me the application turns the whole image black or rather inverts it. The white becomes black and black becomes white. And it is doing this automatically. However other images I scan in it scans fine though the other images are not faxed to me. Anyhow an example of the code I am using is pasted below: My problem is that it inverts images when it shouldn't.

Dim fileName As String
fileName = "c:\image.tif"
Call EZTwain.SetHideUI(1)
Call EZTwain.SetIndicators(0)
Call EZTwain.SetFileAppendFlag(0)

If EZTwain.OpenSource("Visioneer 9650 V1.10") <> 0 Then
Call EZTwain.SetPixelType(0)
Call EZTwain.SetBitDepth(1)
Call EZTwain.SetResolution(200)
Call EZTwain.SetXferCount(1)
Call EZTwain.SetAutoScan(0)
Call EZTwain.DIB_SmartThreshold(Me.Handle)
Call EZTwain.AcquireToFilename(Me.Handle, fileName)

End If
If EZTwain.LastErrorCode() <> 0 Then
Call EZTwain.ReportLastError("Unable to scan.")
End If

Any help offered is greatly appreciated.
 
Top Bottom