Leadtools TWAIN (Leadtools.Twain assembly)
LEAD Technologies, Inc

ImageEffects Property (TwainProperties)

Example 





Gets or sets image effects data properties for the current data source
Syntax
public TwainImageEffectsProperties ImageEffects {get; set;}
'Declaration
 
Public Property ImageEffects As TwainImageEffectsProperties
'Usage
 
Dim instance As TwainProperties
Dim value As TwainImageEffectsProperties
 
instance.ImageEffects = value
 
value = instance.ImageEffects
public TwainImageEffectsProperties ImageEffects {get; set;}
 get_ImageEffects();
set_ImageEffects(value);
public:
property TwainImageEffectsProperties ImageEffects {
   TwainImageEffectsProperties get();
   void set (    TwainImageEffectsProperties value);
}

Property Value

TwainImageEffects structure contains Image effects data class.
Remarks
This property should be called after calling get TwainSession.Properties property After you update this structure items, you can update the values to data source by calling set TwainSession.Properties property.
Example
 
Public Sub ImageEffectsPropertyExample(ByVal parent As IWin32Window)
   Try
      Dim session As TwainSession = New TwainSession()
      session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)

      Dim props As TwainProperties = session.Properties
      Dim imageEfx As TwainImageEffectsProperties = props.ImageEffects

      imageEfx.PixelFlavor = TwainImagePixelFlavor.Vanilla
      imageEfx.ColorScheme = TwainColorScheme.BlackWhite
      imageEfx.Highlight = 50
      imageEfx.Shadow = 50
      imageEfx.Brightness = 500
      imageEfx.Contrast = 100

      Dim buffer As String = String.Format("Current used Halftone = {0}", imageEfx.Halftone)
      MessageBox.Show(buffer)

      props.ImageEffects = imageEfx
      session.Properties = props
      session.Shutdown()
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try
End Sub
public void ImageEffectsPropertyExample(IWin32Window parent)
{
   try
   {
      TwainSession session = new TwainSession();
      session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);

      TwainProperties props = session.Properties;
      TwainImageEffectsProperties imageEfx = props.ImageEffects;

      imageEfx.PixelFlavor = TwainImagePixelFlavor.Vanilla;
      imageEfx.ColorScheme = TwainColorScheme.BlackWhite;
      imageEfx.Highlight = 50;
      imageEfx.Shadow = 50;
      imageEfx.Brightness = 500;
      imageEfx.Contrast = 100;

      string buffer = string.Format("Current used Halftone = {0}", imageEfx.Halftone);
      MessageBox.Show(buffer);

      props.ImageEffects = imageEfx;
      session.Properties = props;
      session.Shutdown();
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

TwainProperties Structure
TwainProperties Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.