Gets the specified extended image information item.
public object GetItem(
int index,
int barcodeTextIndex
)
Public Function GetItem( _
ByVal index As Integer, _
ByVal barcodeTextIndex As Integer _
) As Object
public:
Object^ GetItem(
int index,
int barcodeTextIndex
)
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.
The specified extended image information item, cast as an object. If an error occurs an exception is thrown.
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.
Imports Leadtools
Imports Leadtools.Twain
Public Sub GetItemExample(ByVal parent As IntPtr)
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
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);
}
}
Products |
Support |
Feedback: GetItem Method - Leadtools.Twain |
Introduction |
Help Version 19.0.2017.3.22
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.