LEADTOOLS Support
Imaging
Imaging SDK Questions
Re: When I set Compression, error has happened.
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Sunday, October 18, 2009 10:29:03 PM(UTC)
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
#2
Posted
:
Sunday, October 18, 2009 11:06:12 PM(UTC)
Groups: Registered
Posts: 15
My leadtools version is 15.0J
#3
Posted
:
Monday, October 19, 2009 12:22:04 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
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.zipPlease 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:20:28 PM(UTC)
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:37:22 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
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
LEADTOOLS Support
Imaging
Imaging SDK Questions
Re: When I set Compression, error has happened.
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.