public static Guid GetFormatGuid(WiaFileFormats fileFormat)
fileFormat
The WIA item transfer format ID. For a list of available transfer formats, refer to WiaFileFormats.
The relevant System.Guid value for the file format Id.
Each WIA item's transfer format listed in the WiaFileFormats enumeration has a corresponding System.Guid value. To get that value, call the GetFormatGuid method, passing the format Id for the corresponding GUID value.
using Leadtools;using Leadtools.Codecs;using Leadtools.Wia;public void EnumFormatsExample(IntPtr parent){if (!WiaSession.IsAvailable(WiaVersion.Version1)){Console.WriteLine("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){Console.WriteLine("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);}}