←Select platform

WiaCompressionMode Enumeration

Summary
Compression to be used while performing data transfer from WIA source. For more information refer to WIA_IPA_COMPRESSION property ID in Microsoft Windows SDK Documentation.

Syntax
C#
C++/CLI
Python
public enum WiaCompressionMode 
public enum class WiaCompressionMode : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable   
class WiaCompressionMode(Enum): 
   None = 0 
   Rle4 = 1 
   Rle8 = 2 
   Group3 = 3 
   Group4 = 4 
   Jpeg = 5 
   Jbig = 6 
   Jpeg2000 = 7 
   Png = 8 
Members
ValueMemberDescription
0NoneNo compression is to be used.
1Rle4RLE4 compression.
2Rle8RLE8 compression.
3Group3Group 3 compression.
4Group4Group 4 compression.
5JpegJPEG compression.
6JbigJBIG compression (only supported in Windows Vista or later).
7Jpeg2000JPEG 2000 compression (only supported in Windows Vista or later).
8PngPNG compression (only supported in Windows Vista or later).
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 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Wia Assembly

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