L_TwainGetExtendedImageInfo

Summary

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

Syntax

#include "lttwn.h"

L_LTTWN_API L_INT L_TwainGetExtendedImageInfo(hSession, ptwExtImgInfo)

Parameters

HTWAINSESSION hSession

Handle to an existing TWAIN session. This handle is obtained by calling L_TwainInitSession or L_TwainInitSession2.

TW_EXTIMAGEINFO * ptwExtImgInfo

Pointer to a TW_EXTIMAGEINFO structure that references extended image information.

Returns

Value Meaning
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 text, Barcode data, etc. For more information on extended image information, refer to the TWAIN specification.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This function can be passed as the callback to L_TwainAcquire function.

L_INT TwainGetExtendedImageInfoExample(HTWAINSESSION hSession, 
                                                         pBITMAPHANDLE pBitmap, 
                                                         L_VOID      * pUserData) 
{ 
 
   UNREFERENCED_PARAMETER(pBitmap); 
   UNREFERENCED_PARAMETER(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; 
      nRet = L_TwainGetExtendedImageInfo (hSession, pExtImg); 
      if (nRet == SUCCESS) 
      { 
         // Do processing to returned values 
         nRet = L_TwainFreeExtendedImageInfoStructure (&pExtImg); 
         if(nRet != SUCCESS) 
            return nRet; 
      } 
 
      GlobalFreePtr (pExtImg); 
   } 
 
   return nRet; 
} 

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.