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 : Monday, November 2, 2009 2:47:51 AM(UTC)
kingpanax

Groups: Registered
Posts: 3


my code:

public void MyAcquireFast(IWin32Window parent) 

   TwainSession session = new TwainSession(); 
   session.Startup(parent, "", "", "", "", TwainStartupFlags.None); 
 
   session.EnableAcquireMultiPageEvent = false;  
   session.AcquireFast("d:\\test.BMP", 
                       TwainFastUserInterfaceFlags.None, 
                       TwainTransferMode.File, 
                       RasterImageFormat.BMP, 1, true, 0, true); 
   session.Shutdown(); 
}

its work.but it output BlackWhite and BMP Format file. I use

 session.AcquireFast("d:\\test.jpg", 
                       TwainFastUserInterfaceFlags.None, 
                       TwainTransferMode.File, 
                       RasterImageFormat.jpeg, 1, true, 0, true);

its Exception, i need RGB and JPEG format file. how can i do?

 

 

 

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 : Monday, November 2, 2009 6:00:36 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

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

The TwainSession.AcquireFast method takes a parameter named bitsPerPixel.
You are passing a value of 1 in both cases.
With BMP files, 1 bit means 2 colors only (usually black and white, but could be others).
With JPEG files, 1 bit is NOT a valid value. You should pass 24 bits (color) or if your driver supports it, you could pass 8 for grayscale.
 
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-2024, Yet Another Forum.NET
This page was generated in 0.071 seconds.