←Select platform

Amount Property

Summary
Gets or sets the amount to change the sharpness. This is a dependency property.
Syntax
C#
C++/CLI
public double Amount { get; set; } 
public: 
property double Amount { 
   double get(); 
   void set (    double ); 
} 

Property Value

The amount to change the sharpness.Negative sharpness values decrease the sharpness of the image and positive sharpness values increase the sharpness. Default value is 1.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.Windows.Controls; 
using Leadtools.Windows.Media; 
using Leadtools.Windows.Media.Effects; 
 
class SharpenEffectExampleWindow : Window 
{ 
   public SharpenEffectExampleWindow() 
   { 
      StackPanel sp = new StackPanel(); 
      Content = sp; 
 
      ImageViewer theViewer = new ImageViewer(); 
 
      theViewer.HorizontalAlignment = HorizontalAlignment.Center; 
      theViewer.VerticalAlignment = VerticalAlignment.Top; 
      theViewer.ImageHorizontalAlignment = HorizontalAlignment.Left; 
      theViewer.ImageVerticalAlignment = VerticalAlignment.Top; 
 
      sp.Children.Add(theViewer); 
 
      // Create the sliders 
      TextBlock tb = new TextBlock(); 
      tb.HorizontalAlignment = HorizontalAlignment.Center; 
      tb.Text = "Amount:"; 
      sp.Children.Add(tb); 
 
      Slider theSlider = new Slider(); 
      theSlider.Minimum = -10.0; 
      theSlider.Maximum = 10.0; 
      theSlider.Width = 400; 
      theSlider.Orientation = Orientation.Horizontal; 
      theSlider.IsSnapToTickEnabled = true; 
      theSlider.TickPlacement = System.Windows.Controls.Primitives.TickPlacement.BottomRight; 
      theSlider.TickFrequency = 0.1; 
      theSlider.AutoToolTipPrecision = 2; 
      theSlider.AutoToolTipPlacement = System.Windows.Controls.Primitives.AutoToolTipPlacement.BottomRight; 
 
      sp.Children.Add(theSlider); 
 
      // Load an image into the viewer 
      theViewer.Source = new BitmapImage(new Uri(System.IO.Path.Combine(LEAD_VARS.ImagesDir, "Cannon.jpg"))); 
 
      // Create the effect 
      SharpenEffect effect = new SharpenEffect(); 
      effect.Amount = 1.0; 
      theViewer.ImageEffect = effect; 
 
      // Bind the properties 
      Binding bind = new Binding(); 
      bind.Source = effect; 
      bind.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; 
      bind.Path = new PropertyPath("Amount"); 
      theSlider.SetBinding(Slider.ValueProperty, bind); 
 
      Title = "Using SharpenEffect"; 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

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