←Select platform

GetItem Method

Summary
Gets the specified extended image information item.

Syntax
C#
C++/CLI
Python
public object GetItem( 
   int index, 
   int barcodeTextIndex 
) 
public: 
Object^ GetItem(  
   int index, 
   int barcodeTextIndex 
)  
def GetItem(self,index,barcodeTextIndex): 

Parameters

index
Index into the array of extended image information.

barcodeTextIndex
Additional parameter that contains extended image information.

For example when getting barcode text, the barcode text length will be passed in this parameter.

Return Value

The specified extended image information item, cast as an object. If an error occurs an exception is thrown.

Remarks

Before calling GetItem, check the value of ReturnCode to ensure the attribue is supported and a value is available. Possible values are:

TwainReturnCode.Success - Extended Image Information retrieved successfully TwainReturnCode.InfoNotSupported - Extended Image Information attribute not supported by the device. TwainReturnCode.DataNotAvailable - Extended Image Information attribute supported, but no value was found (i.e. Would occur if no barcode data were found.) Extended image information can be Barcode texts, Barcode data, etc. This method can only be called from within the AcquirePage event.

Example
C#
using Leadtools; 
using Leadtools.Twain; 
 
 
public void GetItemExample(IntPtr parent) 
{ 
   try 
   { 
      TwainSession session = new TwainSession(); 
      session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None); 
 
      TwainExtraImageInformation twainExtImageInfo = new TwainExtraImageInformation(1); 
 
      twainExtImageInfo.GetInformation(0).InfoId = TwainExtendedImage.BarcodeText; 
      twainExtImageInfo.GetInformation(0).ItemType = TwainItemType.Uint32; 
 
      session.UpdateExtraImageInformation(twainExtImageInfo); 
 
      if (twainExtImageInfo.GetInformation(0).ReturnCode == TwainReturnCode.Success) 
      { 
         for (int i = 0; i < twainExtImageInfo.GetInformation(0).Count; i++) 
         { 
            uint item = (uint)twainExtImageInfo.GetInformation(0).GetItem(i, 0); 
            //Do more processing on the item value 
         } 
      } 
 
      session.Shutdown(); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show(ex.Message); 
   } 
} 
Requirements

Target Platforms

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

Leadtools.Twain Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.