L_TwainGetExtendedImageInfo

#include "lttw2.h"

L_INT EXT_FUNCTION L_TwainGetExtendedImageInfo(hSession, ptwExtImgInfo)

HTWAINSESSION hSession;

/* handle to an existing TWAIN session */

TW_EXTIMAGEINFO * ptwExtImgInfo;

/* pointer to a structure */

Gets the extended image information related to the image acquired by the L_TwainAcquire function.

Parameter

Description

hSession

Handle to an existing TWAIN session. This handle is obtained by calling the L_TwainInitSession function.

ptwExtImgInfo

Pointer to a TW_EXTIMAGEINFO structure that references extended image info to fill.

Returns

SUCCESS

The function was successful.

! = SUCCESS

An error occurred. Refer to Return Codes.

Comments

This function can only be called during the LTWAINBITMAPCALLBACK callback function, called by the L_TwainAcquire function, and only after a page has been acquired from a TWAIN source.

Extended image information can be Barcode texts, Barcode data, etc. For more information on extended image information, refer to the Twain 1.9 Specification, available at www.twain.org.

Required DLLs and Libraries

LTTWN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_TwainAcquire, LTWAINBITMAPCALLBACK, L_TwainInitSession, L_TwainEndSession.

Topics:

How to Acquire from the TWAIN Source

 

TWAIN Functionality: Extended Image Information Functions.

Example

   // This function can be passed as the callback to L_TwainAcquire function
   L_INT TwainAcquireCB (HTWAINSESSION hSession, pBITMAPHANDLE pBitmap, L_VOID * pUserData) 
   {
      L_INT nRet = SUCCESS; 
      TW_EXTIMAGEINFO * pExtImg = NULL; 

      pExtImg = (TW_EXTIMAGEINFO *)GlobalAllocPtr (GHND, sizeof (TW_EXTIMAGEINFO) + sizeof(TW_INFO)); 
      if (pExtImg) 
      {
         pExtImg->NumInfos = 2; 
         pExtImg->Info[1].InfoID = TWEI_BARCODECOUNT; 
         pExtImg->Info[1].ItemType = TWTY_UINT32; 
         pExtImg->Info[1].InfoID = TWEI_BARCODETYPE; 
         pExtImg->Info[1].ItemType = TWTY_UINT32; 

         if (L_TwainGetExtendedImageInfo (hSession, pExtImg) == SUCCESS) 
         {
            // Do processing to returned values
            L_TwainFreeExtendedImageInfoStructure (&pExtImg); 
         }

         GlobalFreePtr (pExtImg); 
      }

      return nRet; 
   }