Enumerates all of the available WIA driver transfer formats.
public void EnumFormats(object item,Leadtools.Wia.WiaEnumFormatsFlags flags)
Public Sub EnumFormats( _ByVal item As Object, _ByVal flags As Leadtools.Wia.WiaEnumFormatsFlags _)
public:void EnumFormats(Object^ item,Leadtools.Wia.WiaEnumFormatsFlags flags)
item
Handle to the item having its supported transfer formats enumerated. Retrieve this parameter by either calling the GetRootItem method to get the device's root item itself, or by enumerating the child items of the device through a call to EnumChildItems method.
flags
Reserved for future use, pass WiaEnumFormatsFlags.None.
This function will enumerate all of the available WIA driver transfer formats for the specified item.
Each enumerated transfer format will be sent to the user through the EnumFormatsEvent event. Add this event when enumerating the device's transfer formats. To cancel the enumeration proces, add the EnumFormatsEvent event and then set the Cancel member of the WiaEnumFormatsEventArgs to true.
For more information, refer to Managing WIA Sources.
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.Wia<TestMethod()> _#If Not LEADTOOLS_V19_OR_LATER ThenPublic Sub EnumFormatsExample(ByVal parent As IWin32Window)#ElsePublic Sub EnumFormatsExample(ByVal parent As IntPtr)#End If ' #If LEADTOOLS_V19_OR_LATER ThenIf (Not WiaSession.IsAvailable(WiaVersion.Version1)) ThenMessageBox.Show("WIA version 1.0 not installed.")ReturnEnd IfDim session As WiaSession = New WiaSession()session.Startup(WiaVersion.Version1)Dim res As DialogResult = session.SelectDeviceDlg(parent, WiaDeviceType.Default, WiaSelectSourceFlags.NoDefault)If res <> DialogResult.OK ThenMessageBox.Show("Error selecting WIA device.")session.Shutdown()ReturnEnd IfAddHandler session.EnumFormatsEvent, AddressOf session_EnumFormatsEventDim rootItem As Object = session.GetRootItem(Nothing)If Not rootItem Is Nothing Thensession.EnumFormats(rootItem, WiaEnumFormatsFlags.None)End IfRemoveHandler session.EnumFormatsEvent, AddressOf session_EnumFormatsEventsession.Shutdown()End SubPrivate Sub session_EnumFormatsEvent(ByVal sender As Object, ByVal e As WiaEnumFormatsEventArgs)Dim strMsg As String = String.EmptystrMsg = String.Format("WIA Formats count = {0}" & Constants.vbLf, e.FormatsCount)Console.WriteLine(strMsg)' print out which formats were received into the console window.If e.FormatsCount > 0 ThenDim formatGuid As Guid = wiaSession.GetFormatGuid(e.Format)strMsg = String.Format("WIA Format: {0}" & Constants.vbLf & "WIA Format Transfer Mode: {1}" & Constants.vbLf & "WIA Format Guid: " & Constants.vbLf + Constants.vbLf, e.Format.ToString(), e.TransferMode.ToString(), formatGuid)Console.WriteLine(strMsg)End IfEnd Sub
using Leadtools;using Leadtools.Codecs;using Leadtools.Wia;[TestMethod]#if !LEADTOOLS_V19_OR_LATERpublic void EnumFormatsExample(IWin32Window parent)#elsepublic void EnumFormatsExample(IntPtr parent)#endif // #if !LEADTOOLS_V19_OR_LATER{if (!WiaSession.IsAvailable(WiaVersion.Version1)){MessageBox.Show("WIA version 1.0 not installed.");return;}WiaSession wiaSession = new WiaSession();wiaSession.Startup(WiaVersion.Version1);DialogResult res = wiaSession.SelectDeviceDlg(parent, WiaDeviceType.Default, WiaSelectSourceFlags.NoDefault);if (res != DialogResult.OK){MessageBox.Show("Error selecting WIA device.");wiaSession.Shutdown();return;}wiaSession.EnumFormatsEvent += new EventHandler<WiaEnumFormatsEventArgs>(wiaSession_EnumFormatsEvent);object rootItem = wiaSession.GetRootItem(null);if (rootItem != null){wiaSession.EnumFormats(rootItem, WiaEnumFormatsFlags.None);}wiaSession.EnumFormatsEvent -= new EventHandler<WiaEnumFormatsEventArgs>(wiaSession_EnumFormatsEvent);wiaSession.Shutdown();}void wiaSession_EnumFormatsEvent(object sender, WiaEnumFormatsEventArgs e){string strMsg = string.Empty;strMsg = string.Format("WIA Formats count = {0}\n", e.FormatsCount);Console.WriteLine(strMsg);// print out the received formats into the console window.if (e.FormatsCount > 0){Guid formatGuid = WiaSession.GetFormatGuid(e.Format);strMsg = string.Format("WIA Format: {0}\nWIA Format Transfer Mode: {1}\nWIA Format Guid: \n\n", e.Format.ToString(), e.TransferMode.ToString(), formatGuid);Console.WriteLine(strMsg);}}
|
Products |
Support |
Feedback: EnumFormats Method - Leadtools.Wia |
Introduction |
Help Version 19.0.2017.3.21
|

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.