Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS TWAIN C DLL Help

L_TwainGetExtendedImageInfo

Show in webframe

#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 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;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.