Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Sunday, October 18, 2009 10:34:03 PM(UTC)

sky2009  
sky2009

Groups: Registered
Posts: 15


Hello.

I have two scannar.

One is kodak 200,other is kodak 800

On the kodak 200,I run the source, is OK.

But on the kodak 800,use the same source,error has happened.

Error message:

SncComponent.SetScanParam: Leadtools.Twain.TwainException: Invalid capability value
   Leadtools.Twain.TwainException.CheckErrorCode(Int32 code)
    Leadtools.Twain.TwainSession.SetCapability(TwainCapability capability, TwainSetCapabilityMode mode)
   NBC.Input.Snc.SncComponent.SetCapOneValue(TwainCapabilityType capType, TwainItemType itemType, Object data)  D:\NBC Input\NBC.Input.Snc\SncComponent.vb:行 915
   NBC.Input.Snc.SncComponent.SetCompression(UInt16 ushtCompression)  D:\NBC Input\NBC.Input.Snc\SncComponent.vb:行 1021
   NBC.Input.Snc.SncComponent.SetScanParam(Int32 intScanKbn)  D:\NBC Input\NBC.Input.Snc\SncComponent.vb:行 290

 

Source:

SetXferMech(CUShort(TwainTransferMechanism.Native))

SetPixelType(TwainCapabilityValue.PixelTypeBW)

SetImageFileFormat(CUShort(TwainFileFormat.Tiff))

SetCompression(CUShort(TwainCompressionMode.Group4))

 

Private Sub SetCompression(ByVal ushtCompression As UShort)
        SetCapOneValue(TwainCapabilityType.ImageCompression, TwainItemType.Uint16, ushtCompression)

End Sub

 

Why?

Wait you reply.

Very Thank you

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, October 18, 2009 11:11:12 PM(UTC)

sky2009  
sky2009

Groups: Registered
Posts: 15


My leadtools version is 15.0J
 
#3 Posted : Monday, October 19, 2009 12:27:04 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Do you get this error when trying to set the compression? If yes, does the kodak 800 scanner supports the Group4 compression?

You can check the supported compression values (ICAP_COMPRESSION) by using the standard Twain test utility from the Twain Working Group. This program is called Twacker and you can get it from here: http://www.twain.org/devfiles/twack.zip

Please provide me with the exact code that you use to set the compression.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#4 Posted : Monday, October 19, 2009 11:25:28 PM(UTC)

sky2009  
sky2009

Groups: Registered
Posts: 15


Thanks for your reply.

I have confirmed that when I try to set the compression, error will be throwed.

And I query some document that kodak 800 support the Group4 compression.

I correct the source like follow.

SetXferMech(CUShort(TwainTransferMechanism.Native))

SetXferMech(CUShort(TwainTransferMechanism.File))

Use TwainTransferMechanism.File parameter, set the compression is OK and no error.

But when scan finished,use the follow method to save image.Error happened too.

 

Error reason is e.image  is nothing. So NullException will be throwed.

Why?

    Private Sub AcquirePageEvent(ByVal sender As Object, ByVal e As TwainAcquirePageEventArgs)

        Dim strImageFileName As String
        Dim intDegrees As Integer

        ' file name
        strImageFileName = GetImageFileName()

        ' degrees
        intDegrees = GetDegrees()

        ' Rotate Image
        If intDegrees <> ENM_ORIENTATION.DEGREES_0 Then
            RotateImage(intDegrees, e.Image)
        End If

        ' save image to disk
        _codecs.Save(e.Image, strImageFileName, fileFormat, e.Image.BitsPerPixel)
    End Sub

 

 
#5 Posted : Tuesday, October 20, 2009 2:42:22 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

When you use the File transfer mode, the image is stored in a disk file directly. It is not passed to the e.Image event parameter.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.167 seconds.