Applies an emboss effect to an image, letting you specify the depth and shift of the effect.
public class EmbossEffect : System.Windows.Media.Effects.ShaderEffect, System.Windows.Media.Animation.IAnimatablePublic Class EmbossEffectInherits System.Windows.Media.Effects.ShaderEffectImplements System.Windows.Media.Animation.IAnimatable
public ref class EmbossEffect : public System.Windows.Media.Effects.ShaderEffect, System.Windows.Media.Animation.IAnimatable
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.Windows.ControlsImports Leadtools.Windows.MediaImports Leadtools.Windows.Media.EffectsClass EmbossEffectExampleWindowInherits WindowPublic Sub New()Dim sp As New StackPanel()Content = spDim theViewer As New ImageViewer()theViewer.HorizontalAlignment = HorizontalAlignment.CentertheViewer.VerticalAlignment = VerticalAlignment.ToptheViewer.ImageHorizontalAlignment = HorizontalAlignment.LefttheViewer.ImageVerticalAlignment = VerticalAlignment.Topsp.Children.Add(theViewer)' Create the slidersDim tb As New TextBlock()tb.HorizontalAlignment = HorizontalAlignment.Centertb.Text = "Amount:"sp.Children.Add(tb)Dim amountSlider As New Slider()amountSlider.Minimum = 0.0amountSlider.Maximum = 1.0amountSlider.Width = 400amountSlider.Orientation = Orientation.HorizontalamountSlider.IsSnapToTickEnabled = TrueamountSlider.TickPlacement = System.Windows.Controls.Primitives.TickPlacement.BottomRightamountSlider.TickFrequency = 0.1amountSlider.AutoToolTipPrecision = 2amountSlider.AutoToolTipPlacement = System.Windows.Controls.Primitives.AutoToolTipPlacement.BottomRightsp.Children.Add(amountSlider)tb = New TextBlock()tb.HorizontalAlignment = HorizontalAlignment.Centertb.Text = "Width:"sp.Children.Add(tb)Dim widthSlider As New Slider()widthSlider.Minimum = 0.0widthSlider.Maximum = 1.0widthSlider.Width = 400widthSlider.Orientation = Orientation.HorizontalwidthSlider.IsSnapToTickEnabled = TruewidthSlider.TickPlacement = System.Windows.Controls.Primitives.TickPlacement.BottomRightwidthSlider.TickFrequency = 0.1widthSlider.AutoToolTipPrecision = 2widthSlider.AutoToolTipPlacement = System.Windows.Controls.Primitives.AutoToolTipPlacement.BottomRightsp.Children.Add(widthSlider)' Load an image into the viewertheViewer.Source = New BitmapImage(New Uri(System.IO.Path.Combine(LEAD_VARS.ImagesDir, "Cannon.jpg")))' Create the effectDim effect As New EmbossEffect()effect.Amount = 0.5effect.Width = 0.003theViewer.ImageEffect = effect' Bind the propertiesDim bind As New Binding()bind.Source = effectbind.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChangedbind.Path = New PropertyPath("Amount")amountSlider.SetBinding(Slider.ValueProperty, bind)bind = New Binding()bind.Source = effectbind.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChangedbind.Path = New PropertyPath("Width")widthSlider.SetBinding(Slider.ValueProperty, bind)Title = "Using EmbossEffect"End SubEnd ClassPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
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 slidersTextBlock 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 viewertheViewer.Source = new BitmapImage(new Uri(System.IO.Path.Combine(LEAD_VARS.ImagesDir,"Cannon.jpg")));// Create the effectEmbossEffect effect = new EmbossEffect();effect.Amount = 0.5;effect.Width = 0.003;theViewer.ImageEffect = effect;// Bind the propertiesBinding 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:\Users\Public\Documents\LEADTOOLS Images";}
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.Windows.Media;using Leadtools.Windows.Media.Effects;using Leadtools.Windows.Controls;class EmbossEffectExampleWindow : UserControl{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 slidersTextBlock 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;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;sp.Children.Add(widthSlider);// Load an image into the viewertheViewer.Source = new BitmapImage(new Uri(LeadtoolsExamples.Common.ImagesPath.Path + "Cannon.jpg"));// Create the effectEmbossEffect effect = new EmbossEffect();effect.Amount = 0.5;effect.Width = 0.003;theViewer.ImageEffect = effect;// Bind the propertiesBinding bind = new Binding();bind.Source = effect;bind.UpdateSourceTrigger = UpdateSourceTrigger.Default;bind.Path = new PropertyPath("Amount");amountSlider.SetBinding(Slider.ValueProperty, bind);bind = new Binding();bind.Source = effect;bind.UpdateSourceTrigger = UpdateSourceTrigger.Default;bind.Path = new PropertyPath("Width");widthSlider.SetBinding(Slider.ValueProperty, bind);}}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.Windows.ControlsImports Leadtools.Windows.MediaImports Leadtools.Windows.Media.EffectsClass EmbossEffectExampleWindowInherits UserControlPublic Sub New()Dim sp As New StackPanel()Content = spDim theViewer As New ImageViewer()theViewer.HorizontalAlignment = HorizontalAlignment.CentertheViewer.VerticalAlignment = VerticalAlignment.ToptheViewer.ImageHorizontalAlignment = HorizontalAlignment.LefttheViewer.ImageVerticalAlignment = VerticalAlignment.Topsp.Children.Add(theViewer)' Create the slidersDim tb As New TextBlock()tb.HorizontalAlignment = HorizontalAlignment.Centertb.Text = "Amount:"sp.Children.Add(tb)Dim amountSlider As New Slider()amountSlider.Minimum = 0.0amountSlider.Maximum = 1.0amountSlider.Width = 400amountSlider.Orientation = Orientation.Horizontalsp.Children.Add(amountSlider)tb = New TextBlock()tb.HorizontalAlignment = HorizontalAlignment.Centertb.Text = "Width:"sp.Children.Add(tb)Dim widthSlider As New Slider()widthSlider.Minimum = 0.0widthSlider.Maximum = 1.0widthSlider.Width = 400widthSlider.Orientation = Orientation.Horizontalsp.Children.Add(widthSlider)' Load an image into the viewertheViewer.Source = New BitmapImage(New Uri(LeadtoolsExamples.Common.ImagesPath.Path + "Cannon.jpg"))' Create the effectDim effect As New EmbossEffect()effect.Amount = 0.5effect.Width = 0.003theViewer.ImageEffect = effect' Bind the propertiesDim bind As New Binding()bind.Source = effectbind.UpdateSourceTrigger = UpdateSourceTrigger.Defaultbind.Path = New PropertyPath("Amount")amountSlider.SetBinding(Slider.ValueProperty, bind)bind = New Binding()bind.Source = effectbind.UpdateSourceTrigger = UpdateSourceTrigger.Defaultbind.Path = New PropertyPath("Width")widthSlider.SetBinding(Slider.ValueProperty, bind)End SubEnd Class
<Window x:Class="EmbossEffectExample"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:leadControls="clr-namespace:Leadtools.Windows.Controls;assembly=Leadtools.Windows.Controls"xmlns:leadEffects="clr-namespace:Leadtools.Windows.Media.Effects;assembly=Leadtools.Windows.Media.Effects"Height="600" Width="800"><StackPanel><leadControls:ImageViewerHorizontalAlignment="Center" VerticalAlignment="Top"ImageHorizontalAlignment="Left" ImageVerticalAlignment="Top"Source="file:///c:\users\Public\Documents\LEADTOOLS Images\cannon.jpg"><leadControls:ImageViewer.ImageEffect><leadEffects:EmbossEffectAmount="{Binding Value, ElementName=AmountSlider, UpdateSourceTrigger=PropertyChanged}"Width="{Binding Value, ElementName=WidthSlider, UpdateSourceTrigger=PropertyChanged}"></leadEffects:EmbossEffect></leadControls:ImageViewer.ImageEffect></leadControls:ImageViewer><TextBlock HorizontalAlignment="Center" Text="Amount:"/><Slider x:Name="AmountSlider"Minimum="0.0" Maximum="1.0" TickFrequency="0.1"Width="400" Orientation="Horizontal"IsSnapToTickEnabled="True" TickPlacement="BottomRight"AutoToolTipPrecision="2" AutoToolTipPlacement="BottomRight"></Slider><TextBlock HorizontalAlignment="Center" Text="Width:"/><Slider x:Name="WidthSlider"Minimum="0.0" Maximum="1.0" TickFrequency="0.1"Width="400" Orientation="Horizontal"IsSnapToTickEnabled="True" TickPlacement="BottomRight"AutoToolTipPrecision="2" AutoToolTipPlacement="BottomRight"></Slider></StackPanel></Window>
|
Products |
Support |
Feedback: EmbossEffect Class - Leadtools.Windows.Media.Effects |
Introduction |
Help Version 19.0.2017.3.21
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.