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 > TwainSession Class : ImageEffects Property




Gets or sets the brightness, highlight and contrast values to use when transferring images from the current TWAIN source.

Syntax

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

Example

Visual BasicCopy Code
Public Sub ImageEffectsPropertyExample(ByVal parent As IWin32Window)
   Dim session As TwainSession = New TwainSession()
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)

   Dim imgEffects As TwainImageEffects = session.ImageEffects
   imgEffects.Flags = TwainImageEffectsFlags.NegotiateBrightness Or TwainImageEffectsFlags.NegotiateContrast Or TwainImageEffectsFlags.NegotiateHighlight
   Dim contrast As Single = imgEffects.Contrast
   Dim highlight As Single = imgEffects.Highlight
   Dim msg As String = String.Format("Image Contrst = {0}" & Constants.vbLf & "Image Highlight = {1}", contrast, highlight)
   MessageBox.Show(msg)

   imgEffects.Brightness = 100
   session.ImageEffects = imgEffects

   Dim pageOpts As TwainAcquirePageOptions = session.AcquirePageOptions
   pageOpts.PaperSize = TwainPaperSize.A4
   pageOpts.PaperOrientation = TwainPaperOrientation.Landscape
   session.AcquirePageOptions = pageOpts

   session.Shutdown()
End Sub
C#Copy Code
public void ImageEffectsPropertyExample(IWin32Window parent) 

   TwainSession session = new TwainSession(); 
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None); 
 
   TwainImageEffects imgEffects = session.ImageEffects; 
   imgEffects.Flags = TwainImageEffectsFlags.NegotiateBrightness | TwainImageEffectsFlags.NegotiateContrast | TwainImageEffectsFlags.NegotiateHighlight; 
   float contrast = imgEffects.Contrast; 
   float highlight = imgEffects.Highlight; 
   string msg = String.Format("Image Contrst = {0}\nImage Highlight = {1}", contrast, highlight); 
   MessageBox.Show(msg); 
 
   imgEffects.Brightness = 100; 
   session.ImageEffects = imgEffects; 
 
   TwainAcquirePageOptions pageOpts = session.AcquirePageOptions; 
   pageOpts.PaperSize = TwainPaperSize.A4; 
   pageOpts.PaperOrientation = TwainPaperOrientation.Landscape; 
   session.AcquirePageOptions = pageOpts; 
 
   session.Shutdown(); 
}

Remarks

The ImageEffects property will get and set the brightness, highlight and contrast values for the current TWAIN source.

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