How to use memory transfermode

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
DirkMattner
Posts: 4
Joined: Wed Nov 25, 2009 6:54 pm

How to use memory transfermode

Post by DirkMattner »

Hi Alex,

is there an example using TransferMode.Memory? How do i access the image? In wich format is it? Is it possible to get a compressed image?

Best regards,
Dirk
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: How to use memory transfermode

Post by Alex »

Hello Dirk,

You can set the VSTwain.TransferMode property to TransferMode.Memory and library will use Memory transfer mode.

Compression in Memory transfer mode is not supported in current version of library and will be available in next version.
Access to "raw" image data is not supported and will not be available.

Best regards, Alexander
DirkMattner
Posts: 4
Joined: Wed Nov 25, 2009 6:54 pm

Re: How to use memory transfermode

Post by DirkMattner »

Hi Alex,

that is clear, i've alleready tried this. But it's unclear which format the scanned image is and wich properties are to set before acquiring images. Wich method is to use to get the scanned image? Here is my code the resulting stream/file is not usable. At least for me:-):

Code: Select all


            VSTwain1.TransferMode = TransferMode.Memory;
            VSTwain1.TiffCompression = TiffCompression.None;
            VSTwain1.FileFormat = FileFormat.Tiff;

in VSTwain1_ImageAcquiredEvent i used follwing code to get the image

              MemoryStream s = VSTwain1.GetImageAsStream(i, ImageFileFormat.TIFF);

After that i've got a stream but i don't know in wich format it is. It's not a tiff even not a BMP. What is it?

Best regards,
Dirk
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: How to use memory transfermode

Post by Alex »

What scanner do you use? Maybe your scanner use compression in Memory transfer mode by default? You can disable usage of compression with ICAP_COMPRESSION capability of scanner.

Please generate the log-file and send it to support@vintasoft.com.

Here are steps which you should do if you want to generate a log-file of scanner's work:
  • Set the IsLoggingEnabled property to True before the StartDevice method.
  • Set the path to log-file with the LogFilePath property if path "c:\vstwain.log" is not accessible by your application.
    NOTE: vstwain.log file will be created in the user's temporary directory if path specified in the LogFilePath property is not accessible.
  • Run your application.
  • Send us a log-file and detailed description of the problem.
Best regards, Alexander
DirkMattner
Posts: 4
Joined: Wed Nov 25, 2009 6:54 pm

Re: How to use memory transfermode

Post by DirkMattner »

Hi Alex,

the problem is solved. In memory transfer mode the scanner (innotec scamax 402 cd) sends the data always compressed if you are scanning black/white images regardless your settings for the compressiontype. If your 're scanning gray or colored images the data is send uncompressed regardless your settings for the compressiontype.

best regards
dirk
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: How to use memory transfermode

Post by Alex »

Hi Dirk,

Thank you for the information. Where can I find information about "innotec scamax 402 cd" scanner?
I want to add it to our "white" list on the forum.

Best regards, Alexander
DirkMattner
Posts: 4
Joined: Wed Nov 25, 2009 6:54 pm

Re: How to use memory transfermode

Post by DirkMattner »

Hi Alex,

here http://www.inotec.eu/index.php?id=15 you can get some information about the scanner.

Best regards
Dirk
Post Reply