Leadtools.Twain Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.8.31
ImageEffects Property
See Also  Example
Leadtools.Twain Namespace > TwainProperties Structure : ImageEffects Property




Gets or sets image effects data properties for the current data source

Syntax

Visual Basic (Declaration) 
Public Property ImageEffects As TwainImageEffectsProperties
Visual Basic (Usage)Copy Code
Dim instance As TwainProperties
Dim value As TwainImageEffectsProperties
 
instance.ImageEffects = value
 
value = instance.ImageEffects
C# 
public TwainImageEffectsProperties ImageEffects {get; set;}
Managed Extensions for C++ 
public: __property TwainImageEffectsProperties get_ImageEffects();
public: __property void set_ImageEffects( 
   TwainImageEffectsProperties value
);
C++/CLI 
public:
property TwainImageEffectsProperties ImageEffects {
   TwainImageEffectsProperties get();
   void set (TwainImageEffectsProperties value);
}

Return Value

TwainImageEffects structure contains Image effects data class.

Example

Visual BasicCopy Code
Public Sub ImageEffectsPropertyExample(ByVal parent As IWin32Window)
   Try
      Dim twainSession As TwainSession = New TwainSession()
      twainSession.Startup(parent, "LEAD Technologies, Inc.", "LEAD Twain .NET", "Version 14", "LEADTools Twain test sample", TwainStartupFlags.None)

      Dim props As TwainProperties = twainSession.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
      twainSession.Properties = props
      twainSession.Shutdown()
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try
End Sub
C#Copy Code
public void ImageEffectsPropertyExample(IWin32Window parent) 

   try 
   { 
      TwainSession twainSession = new TwainSession(); 
      twainSession.Startup(parent, "LEAD Technologies, Inc.", "LEAD Twain .NET", "Version 14", "LEADTools Twain test sample", TwainStartupFlags.None); 
 
      TwainProperties props = twainSession.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; 
      twainSession.Properties = props; 
      twainSession.Shutdown(); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show(ex.Message); 
   } 
}

Remarks

This property should be called after calling get Properties property After you update this structure items, you can update the values to data source by calling set Properties property.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also