LEADTOOLS Support
Imaging
Imaging SDK Questions
ERROR_BITPERPIXEL (-27 -Invalid bits/pixel) while scanning
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, April 10, 2008 4:26:18 PM(UTC)
Groups: Registered
Posts: 6
I am trying to scan using L_TwainAcquireMulti using Canon LiDE 25 scanner and keep getting ERROR_BITPERPIXEL (errorcode -27) error. Not sure what the problem is, I read on another post it could be due to the fact the bits/pixel of source images could be different from the new image that needs to be saved.
Params passed to L_TwainAcquireMulti:
L_TCHAR *pszBaseFileName = FILENAME.CMP
L_UINT uFlags = 0
L_UINT uTransferMode = LeadTwainLib.LTWAIN_NATIVE_MODE
L_INT nFormat = LEADLib.FileConstants.FILE_LEAD1BIT
L_INT nBitsPerPixel= 1
L_BOOL bMultiPageFile = 0
L_UINT32 uUserBufSize = 0
L_BOOL bUsePreferredBuffer= 1
LTWAINACQUIRECALLBACK pfnCallBack= IntPtr.Zero
L_VOID * pUserData = IntPtr.Zero
What could be possible cause of the error?
#2
Posted
:
Friday, April 11, 2008 8:42:21 AM(UTC)
Groups: Registered
Posts: 6
Follow up... How do I solve this problem? Preferably not throught LEADLib. Is there a way to change scanner settings?
#3
Posted
:
Sunday, April 13, 2008 5:54:36 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
1. If you use our Fast Twain demo, does it work with the
scanner?
2. Which version of LEADTOOLS are you using?
#4
Posted
:
Tuesday, April 15, 2008 10:50:49 AM(UTC)
Groups: Registered
Posts: 6
I am using version 13 of LEADTools.
Where do I get the Fast Twain Demo from? Could you point to a place in documentation which describes how to use the Fast Twain Demo?
Thanks
#5
Posted
:
Tuesday, April 15, 2008 10:11:55 PM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
Do you specifically need the Fast Twain features? Fast Twain
is a set of optimization functions that speed up data transfer from high-speed
scanners when acquiring large batches of pages. It is only included in
LEADTOOLS Document Imaging toolkits. The DLL API demo for Fast Twain is in this
folder:
LEADTOOLS13\Examples\DLL\FASTTWN
If you only want to perform multi-page scanning, you can use
the regular Acquire function.
If you are using a .NET programming interface, it might be
easier to use the COM objects instead of the C-style DLL API. The regular Twain
demos shipped with toolkit are:
LEADTOOLS13\Examples\DLL\Twain (uses the DLL API)
LEADTOOLS13\Examples\COM\VB\TWAIN32 (uses COM Objects).
#6
Posted
:
Wednesday, April 16, 2008 8:06:24 AM(UTC)
Groups: Registered
Posts: 6
Thanks I will take a look at these, though the application I am working on provides both kind of features - single page scanning and bulk (multiple page scanning). I am getting error code -27 in both cases.
I also tried using Twacker, and noticed that the value of Capability: ICAP_PIXELTYPE is always TWPT_RGB which is 24 bits/pixel. If I change this value to TWPT_BW & do getCurrent it returns TWPT_BW . But if I close twacker and open it again the value gets reset to TWPT_RGB.
Could this be a limitation of the scanner that it is not able to persist TWAIN capability changes?
Would using L_TwainSetCapability to change the value of capability for a particular scanning session help eliminate error code -27?
#7
Posted
:
Thursday, April 17, 2008 2:36:41 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
It is normal for some Twain drivers not to preserve
capability values between scanning sessions, some of them even resetting values
without closing the application. With some drivers, starting to scan a new page
or new group of pages will cause capability values to change.
This means you should always explicitly set the capabilities
you need before every scan job.
#8
Posted
:
Thursday, April 17, 2008 11:25:02 AM(UTC)
Groups: Registered
Posts: 6
Thanks. I used L_TwainSetCapability to set ICAP_PIXELTYPE to TWPT_BW and it works now.
LEADTOOLS Support
Imaging
Imaging SDK Questions
ERROR_BITPERPIXEL (-27 -Invalid bits/pixel) while scanning
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.