L_TwainGetExtendedImageInfo

#include "lttwn.h"

L_LTTWN_API L_INT 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 or L_TwainInitSession2 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 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 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS TWAIN C API Help