Buffered Transfer

Top  Previous  Next

The Buffered Transfer Mode (also called Memory transfers) transfers the image from the Source to the application in individual strips.  The Buffered Mode is supported by all Sources, with some of these Sources capable of doing compressed transfers (see below).

 

Transferring images using the Buffered Transfer mode is less memory intensive than the Native Mode, since the data is not transferred as a single block, but as many individual blocks (or buffers), one at a time until the whole page is acquired*.  This mode should be used if the image to transfer uses a large amount of memory.  Another advantage is that the Source may support compressed buffered transfers.  This allows the Source to transfer the image in a compressed form, making for faster acquisitions.

 

The function that acquires images using the buffered transfer mode is DTWAIN_AcquireBuffered.

 

DTWAIN's implementation of the buffered transfer mode currently supports, the DIB format for uncompressed data and also non-DIB, compressed formats.  The function that sets the type of compression (or no compression) is DTWAIN_SetCompressionType.  If no compression is desired, DTWAIN generates DIBs (just like the native transfer mode).  If compression is on, DTWAIN returns a memory block that represents the image data.  This data can be easily saved to the actual image file if necessary.

 

DTWAIN only supports buffered transfers using strips.  Buffered transfers using tiled data is currently not supported but will be available in a future version of DTWAIN.

 

* Note that by default, DTWAIN will create the entire image in memory.  If this is is still not desirable, a user-defined buffer can be established.  With a user-defined buffer, DTWAIN allocates no memory, and the application is responsible for any memory allocation / deallocation issues.

 

Using a user-defined memory buffer