Leadtools.Twain Namespace > TwainInformation Class : GetItem Method |
public object GetItem( int index, int barcodeTextIndex )
'Declaration Public Function GetItem( _ ByVal index As Integer, _ ByVal barcodeTextIndex As Integer _ ) As Object
'Usage Dim instance As TwainInformation Dim index As Integer Dim barcodeTextIndex As Integer Dim value As Object value = instance.GetItem(index, barcodeTextIndex)
public object GetItem( int index, int barcodeTextIndex )
function Leadtools.Twain.TwainInformation.GetItem( index , barcodeTextIndex )
public: Object^ GetItem( int index, int barcodeTextIndex )
Public Sub GetItemExample(ByVal parent As IWin32Window) Try Dim session As TwainSession = New TwainSession() session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None) Dim twainExtImageInfo As TwainExtraImageInformation = 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 Then Dim i As Integer = 0 Do While i < twainExtImageInfo.GetInformation(0).Count Dim item As UInteger = CUInt(twainExtImageInfo.GetInformation(0).GetItem(i, 0)) 'Do more processing on the item value i += 1 Loop End If session.Shutdown() Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub
public void GetItemExample(IWin32Window 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); } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2