TwainPRO 9 for .NET - User Guide > How To > Acquire Images and Image Information > Access Extended Image Information |
Extended image information is used to pass information such as barcodes or patch codes found on a scanned page. See the TWAIN specification for additional information on Extended Image Information available for retrieval.
The TWAIN Data Source must be compliant with version 1.7 or higher of the TWAIN specification for accessing this extended information. |
The extended image information is accessed during the Scanned event, by getting the ScannedImage, and calling the ScannedImage.GetExtendedImageInfo method. The returned ExtendedImageInfoContainer includes the extended information available for that image. To access the information within the ExtendedImageInfoContainer, the application must cast this object to the appropriate child object: ExtendedImageInfoContainerValueCollection, ExtendedImageInfoContainerValueFloat, or ExtendedImageInfoContainerValueString.
C# Example |
Copy Code
|
---|---|
// This code demonstrates how to access the TWEI_BARCODEX extended image information and add all of the information for a scanned page to a list box public void twainDevice_Scanned(object sender, Accusoft.TwainProSdk.ScannedEventArgs e) { try { ExtendedImageInfoContainer extendedImageInfo = e.ScannedImage.GetExtendedImageInfo(ExtendedImageInfo.TweiBarcodeX); ExtendedImageInfoContainerValueCollection theValues = extendedImageInfo.Values; int i = 0; for (i = 0; i < theValues.Count; i++) { ExtendedImageInfoContainerValueFloat extendedImageInfoFloat = (ExtendedImageInfoContainerValueFloat)theValues[i]; listBox1.Items.Add(extendedImageInfoFloat.Value.ToString()); } } catch (Accusoft.TwainProSdk.TwainProException ex) { ErrorLabel.Text = ex.Message; } } |