Using 8 bit for 24bit in function TwainSetBitDepth

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
brian611
Posts: 5
Joined: Mon Apr 23, 2012 6:15 pm

Using 8 bit for 24bit in function TwainSetBitDepth

Post by brian611 » Tue Mar 05, 2013 6:22 pm

My Fujitsu fi-4120C can support, according to its UI, B&W, Grayscale, Color as 8 colors, 256 colors, or 24 bit color. When I try and use 24 in the TwainSetBitDepth function it fails but will not fail if I use 8 as the bit depth. In looking at the GDPicture Twain sample there is this line:

oGdPictureImaging.TwainSetBitDepth(8); // 24 bpp

My question is how does the 8 represent 24 bit? This leads me to believe that the number you specify in TwainSetBitDepth function does not really represent the actual bit depth even though the parameter description says BitDepth. I am just looking for some clarification on this topic because I need to know if the users are actually scanning in color at 8 bits or 24 bits if I use the 8 as it is used in the GDPicture Twain Sample.

Thanks for your help in advance.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Using 8 bit for 24bit in function TwainSetBitDepth

Post by Loïc » Fri Mar 08, 2013 12:39 pm

Hello Brian,

This is probably an error in the sample. If you want to acquire in color you have first to specify the pixel type and then apply to correct bit depth.

For your need it should be:

Code: Select all

oGdPictureImaging.TwainSetPixelType(TwainPixelType.TWPT_RGB);
oGdPictureImaging.TwainSetBitDepth(24);
Let me know if you need further info.

With best regards,

Loïc

brian611
Posts: 5
Joined: Mon Apr 23, 2012 6:15 pm

Re: Using 8 bit for 24bit in function TwainSetBitDepth

Post by brian611 » Mon Mar 11, 2013 6:13 pm

Thanks but it still will not accept the 24. For the TwainSetPixelType I can use TWPT_RGB, TWPT_PALETTE, TWPT_GRAY, and TWPT_BW. When I use RGB or PALETTE the highest value I can enter for the TwainSetBitDepth is 8 all other values return false when I call the method. In looking at the TwainGetLastResultCode() it returns TWRC_FAILURE and the TwainGetLastConditionCode returns TWCC_CAPSEQERROR. So it looks like the scanner cannot support 24 bit but I don't understand why the scanner UI displays 24bit.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest