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

ImageEffects Property (TwainSession)

Example 





Gets or sets the brightness, highlight and contrast values to use when transferring images from the current TWAIN source.
Syntax
public TwainImageEffects ImageEffects {get; set;}
'Declaration
 
Public Property ImageEffects As TwainImageEffects
'Usage
 
Dim instance As TwainSession
Dim value As TwainImageEffects
 
instance.ImageEffects = value
 
value = instance.ImageEffects
public TwainImageEffects ImageEffects {get; set;}
 get_ImageEffects();
set_ImageEffects(value);
public:
property TwainImageEffects ImageEffects {
   TwainImageEffects get();
   void set (    TwainImageEffects value);
}

Property Value

Image Effects as brightness, highlight and contrast values to use when transferring images from the current TWAIN source
Remarks
The ImageEffects property will get and set the brightness, highlight and contrast values for the current TWAIN source.
Example
 
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
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();
}
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

TwainSession Class
TwainSession Members
Startup Method
Shutdown Method
Acquire Method
MaximumTransferCount Property
DuplexScanningMode Property
EnableDuplexScanning Property
AcquirePageOptions Property
ImageBitsPerPixel Property
ImageUnit Property
ImageFrame Property
IsTransferModeAvailable Method
TransferOptions Property
ShowProgressIndicator Method

 

 


Products | Support | Contact Us | Copyright Notices

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