←Select platform

EmbossEffect Class

Summary
Applies an emboss effect to an image, letting you specify the depth and shift of the effect.
Syntax
C#
C++/CLI
public class EmbossEffect : ShaderEffect 
public ref class EmbossEffect : public System.Windows.Media.Effects.ShaderEffect, System.Windows.Media.Animation.IAnimatable   
Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.Windows.Controls; 
using Leadtools.Windows.Media; 
using Leadtools.Windows.Media.Effects; 
 
class EmbossEffectExampleWindow : Window 
{ 
   public EmbossEffectExampleWindow() 
   { 
      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 amountSlider = new Slider(); 
      amountSlider.Minimum = 0.0; 
      amountSlider.Maximum = 1.0; 
      amountSlider.Width = 400; 
      amountSlider.Orientation = Orientation.Horizontal; 
      amountSlider.IsSnapToTickEnabled = true; 
      amountSlider.TickPlacement = System.Windows.Controls.Primitives.TickPlacement.BottomRight; 
      amountSlider.TickFrequency = 0.1; 
      amountSlider.AutoToolTipPrecision = 2; 
      amountSlider.AutoToolTipPlacement = System.Windows.Controls.Primitives.AutoToolTipPlacement.BottomRight; 
 
      sp.Children.Add(amountSlider); 
 
      tb = new TextBlock(); 
      tb.HorizontalAlignment = HorizontalAlignment.Center; 
      tb.Text = "Width:"; 
      sp.Children.Add(tb); 
 
      Slider widthSlider = new Slider(); 
      widthSlider.Minimum = 0.0; 
      widthSlider.Maximum = 1.0; 
      widthSlider.Width = 400; 
      widthSlider.Orientation = Orientation.Horizontal; 
      widthSlider.IsSnapToTickEnabled = true; 
      widthSlider.TickPlacement = System.Windows.Controls.Primitives.TickPlacement.BottomRight; 
      widthSlider.TickFrequency = 0.1; 
      widthSlider.AutoToolTipPrecision = 2; 
      widthSlider.AutoToolTipPlacement = System.Windows.Controls.Primitives.AutoToolTipPlacement.BottomRight; 
 
      sp.Children.Add(widthSlider); 
 
      // Load an image into the viewer 
      theViewer.Source = new BitmapImage(new Uri(System.IO.Path.Combine(LEAD_VARS.ImagesDir, "Cannon.jpg"))); 
 
      // Create the effect 
      EmbossEffect effect = new EmbossEffect(); 
      effect.Amount = 0.5; 
      effect.Width = 0.003; 
      theViewer.ImageEffect = effect; 
 
      // Bind the properties 
      Binding bind = new Binding(); 
      bind.Source = effect; 
      bind.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; 
      bind.Path = new PropertyPath("Amount"); 
      amountSlider.SetBinding(Slider.ValueProperty, bind); 
 
      bind = new Binding(); 
      bind.Source = effect; 
      bind.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; 
      bind.Path = new PropertyPath("Width"); 
      widthSlider.SetBinding(Slider.ValueProperty, bind); 
 
      Title = "Using EmbossEffect"; 
   } 
} 
 
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.