←Select platform

WiaFileFormats Enumeration

Summary
Preferred image format to use when performing data transfer from the WIA source. For more information, refer to the WIA_IPA_FORMAT property ID in the Microsoft Windows SDK Documentation.

Syntax
C#
C++/CLI
Python
public enum WiaFileFormats 
public enum class WiaFileFormats : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable   
class WiaFileFormats(Enum): 
   None = 0 
   Bmp = 1 
   Ciff = 2 
   Emf = 3 
   Exif = 4 
   Fpx = 5 
   Gif = 6 
   Ico = 7 
   Jbig = 8 
   Jpeg = 9 
   J2k = 10 
   J2kx = 11 
   MemoryBmp = 12 
   Pcd = 13 
   Pct = 14 
   Png = 15 
   Raw = 16 
   RawRgb = 17 
   Tiff = 18 
   Wmf = 19 
   Rtf = 20 
   Xml = 21 
   Html = 22 
   Txt = 23 
   Pdfa = 24 
   Xps = 25 
   Mpg = 26 
   Avi = 27 
   Wav = 28 
   Mp3 = 29 
   Aiff = 30 
   Wma = 31 
   Asf = 32 
   Script = 33 
   Exec = 34 
   Unicode16 = 35 
   Dpof = 36 
Members
ValueMemberDescription
0NoneIndicates that there is no transfer format currently set. The purpose of this member is to determine whether the WiaDataTransferProperties structure has a valid transfer format set.
1Bmp(0x0000000C)Windows bitmap with a header file.
2CiffCamera Image File format
3EmfExtended Windows metafile.
4ExifExchangeable File Format.
5FpxFlashPix format.
6GifGIF image format.
7IcoWindows icon file format.
8JbigThe Joint Bi-level Image Experts Group (JBIG) format (supported only in Windows Vista and later).
9JpegJPEG compressed format.
10J2kJPEG 2000 compressed format.
11J2kxJPEG 2000 compressed format.
12MemoryBmpWindows bitmap without a header file (use this format when doing memory transfer).
13PcdEastman Kodak file format.
14PctApple file format.
15PngW3C PNG format.
16RawRaw format for data transfers only.
17RawRgbRaw RGB format.
18TiffTag Image File Format.
19WmfWindows metafile.
20RtfRich Text File format.
21XmlXML file.
22HtmlHTML format.
23TxtText file.
24PdfaThe PDF/A (ISO/CD 19005-1) format (supported only in Windows Vista and later).
25XpsXML Paper Specification (XPS) Package format (supported only in Windows Vista and later).
26MpgMPEG video format (not supported in either Windows Server 2003 or Windows Vista).
27AviAVI video format (not supported in either Windows Server 2003 or Windows Vista).
28WavWAV audio format.
29Mp3MP3 audio format.
30AiffAIFF audio format.
31WmaWMA audio format.
32AsfWMV video format (not supported in either Windows Server 2003 or Windows Vista).
33ScriptScript file.
34ExecExecutable file.
35Unicode16UNICODE 16-bit encoding.
36DpofDPOF printing format.
Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Wia; 
 
 
WiaSession wiaSession; 
       
public void GetRootItemExample(IntPtr parent) 
{ 
   if (!WiaSession.IsAvailable(WiaVersion.Version1)) 
   { 
      Console.WriteLine("WIA version 1.0 not installed."); 
      return; 
   } 
   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; 
   } 
 
   object rootItem = wiaSession.GetRootItem(null); 
   if (rootItem != null) 
   { 
      wiaSession.EnumItemsEvent += new EventHandler<WiaEnumItemsEventArgs>(wiaSession_EnumItemsEvent); 
 
      wiaSession.EnumChildItems(rootItem); 
 
      wiaSession.EnumItemsEvent -= new EventHandler<WiaEnumItemsEventArgs>(wiaSession_EnumItemsEvent); 
   } 
 
   wiaSession.Shutdown(); 
} 
 
void wiaSession_EnumItemsEvent(object sender, WiaEnumItemsEventArgs e) 
{ 
   if (e.Item != null) 
   { 
      WiaDataTransferProperties dataTransfer = WiaDataTransferProperties.Empty; 
      WiaImageEffectsProperties imageEffects = WiaImageEffectsProperties.Empty; 
 
      WiaProperties properties = wiaSession.GetProperties(e.Item); 
 
      dataTransfer.ImageDataType = WiaImageDataType.Grayscale; 
      imageEffects.Brightness = 250; 
 
      properties.DataTransfer = dataTransfer; 
      properties.ImageEffects = imageEffects; 
      properties.ScanningMode = WiaScanningModeFlags.Feeder;   // set scanning source to Feeder 
      properties.MaximumNumberOfPages = 0;                     // scan all pages in feeder 
      properties.ImageType = WiaImageType.Grayscale; 
      properties.Orientation = WiaOrientation.Portrait; 
 
      WiaImageResolutionProperties imageResolution = properties.ImageResolution; 
      imageResolution.BitsPerPixel = 8; 
      imageResolution.HorizontalResolution = 600; 
      imageResolution.VerticalResolution = 600; 
      properties.ImageResolution = imageResolution; 
 
      wiaSession.SetPropertiesEvent += new EventHandler<WiaSetPropertiesEventArgs>(wiaSession_SetPropertiesEvent); 
 
      wiaSession.SetProperties(e.Item, properties); 
 
      wiaSession.SetPropertiesEvent -= new EventHandler<WiaSetPropertiesEventArgs>(wiaSession_SetPropertiesEvent); 
 
      wiaSession.FreeItem(e.Item); 
   } 
} 
 
void wiaSession_SetPropertiesEvent(object sender, WiaSetPropertiesEventArgs e) 
{ 
   if (e.Error <= 0) 
   { 
      Console.WriteLine("Failed to set the below property:\n\tProperty Id: {0}\n\tProperty Value: {1}\n\tError: {2}\n\n", e.PropertyId.ToString(), e.Value.ToString(), e.Error.ToString()); 
   } 
} 
Requirements

Target Platforms

See Also

Reference

Leadtools.Wia Namespace

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Wia Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.