Leadtools.Windows.Media.Effects Send comments on this topic. | Back to Introduction - LEADTOOLS WPF | Help Version 16.5.9.25
RevEffectCommandBitmapEffect Class
See Also  Members   Example 
Leadtools.Windows.Media.Effects.SpecialEffects Namespace : RevEffectCommandBitmapEffect Class





Adds a pseudo-3D wave effect to the image by drawing lines across the image, basing the line's height at each point on its brightness at that point.

Syntax

Visual Basic (Declaration) 
Public Class RevEffectCommandBitmapEffect 
   Inherits RasterCommandBitmapEffect
Visual Basic (Usage)Copy Code
Dim instance As RevEffectCommandBitmapEffect
C# 
public class RevEffectCommandBitmapEffect : RasterCommandBitmapEffect 
C++/CLI 
public ref class RevEffectCommandBitmapEffect : public RasterCommandBitmapEffect 
XAML Property Element Usage 

RevEffectCommandBitmapEffect ...

XAML Property Element Usage 

RevEffectCommandBitmapEffect ...

Example

Run the RevEffectCommandBitmapEffect on an image.

Visual BasicCopy Code
Public Sub RevEffectCommandBitmapEffectExample(ByVal element As FrameworkElement)
   Dim effect As RevEffectCommandBitmapEffect = New RevEffectCommandBitmapEffect()
   effect.LineSpace = 1
   effect.MaximumHeight = 1
   element.BitmapEffect = effect

   Dim storyboard As Storyboard = New Storyboard()

   Dim animation1 As Int32Animation = New Int32Animation()
   animation1.From = 1
   animation1.To = 50
   animation1.Duration = New Duration(TimeSpan.Parse("0:0:5"))
   animation1.RepeatBehavior = RepeatBehavior.Forever
   animation1.AutoReverse = True

   storyboard.SetTargetName(animation1, "AnimatedBitmapEffect")
   storyboard.SetTargetProperty(animation1, New PropertyPath(RevEffectCommandBitmapEffect.LineSpaceProperty))
   element.RegisterName("AnimatedBitmapEffect", effect)
   storyboard.Children.Add(animation1)

   Dim animation2 As Int32Animation = New Int32Animation()
   animation2.From = 1
   animation2.To = 50
   animation2.Duration = New Duration(TimeSpan.Parse("0:0:5"))
   animation2.RepeatBehavior = RepeatBehavior.Forever
   animation2.AutoReverse = True

   storyboard.SetTargetName(animation2, "AnimatedBitmapEffect")
   storyboard.SetTargetProperty(animation2, New PropertyPath(RevEffectCommandBitmapEffect.MaximumHeightProperty))
   element.RegisterName("AnimatedBitmapEffect", effect)
   storyboard.Children.Add(animation2)

   storyboard.Begin(element)
End Sub
C#Copy Code
public void RevEffectCommandBitmapEffectExample(FrameworkElement element) 

   RevEffectCommandBitmapEffect effect = new RevEffectCommandBitmapEffect(); 
   effect.LineSpace = 1; 
   effect.MaximumHeight = 1; 
   element.BitmapEffect = effect; 
 
   Storyboard storyboard = new Storyboard(); 
 
   Int32Animation animation1 = new Int32Animation(); 
   animation1.From = 1; 
   animation1.To = 50; 
   animation1.Duration = new Duration(TimeSpan.Parse("0:0:5")); 
   animation1.RepeatBehavior = RepeatBehavior.Forever; 
   animation1.AutoReverse = true; 
 
   Storyboard.SetTargetName(animation1, "AnimatedBitmapEffect"); 
   Storyboard.SetTargetProperty(animation1, new PropertyPath(RevEffectCommandBitmapEffect.LineSpaceProperty)); 
   element.RegisterName("AnimatedBitmapEffect", effect); 
   storyboard.Children.Add(animation1); 
 
   Int32Animation animation2 = new Int32Animation(); 
   animation2.From = 1; 
   animation2.To = 50; 
   animation2.Duration = new Duration(TimeSpan.Parse("0:0:5")); 
   animation2.RepeatBehavior = RepeatBehavior.Forever; 
   animation2.AutoReverse = true; 
 
   Storyboard.SetTargetName(animation2, "AnimatedBitmapEffect"); 
   Storyboard.SetTargetProperty(animation2, new PropertyPath(RevEffectCommandBitmapEffect.MaximumHeightProperty)); 
   element.RegisterName("AnimatedBitmapEffect", effect); 
   storyboard.Children.Add(animation2); 
 
   storyboard.Begin(element); 
}

Remarks

  • This command adds a pseudo-3D wave effect to the image. It is similar to the Rutt-Etra Video Synthesizer. The Rutt-Etra video synthesizer was a processor that modulated the deflection lines of a television image so that they appeared to adopt the contours of objects. It was invented by Steve Rutt and Bill Etra in the 1970s.
  • With this command, you set the maximum height to be used for the pixels with the maximum brightness value. The other pixel heights are calculated by linear interpolation. Each line is 1 pixel in width. Control the spacing between the lines that are drawn across the image with the LineSpace parameter.
  • You can get a more stable wave by performing the following:
    1. Apply any type of blur like GaussianCommandBitmapEffect blur with a large radius value.
    2. Apply the RevEffectCommandBitmapEffect and pass a small value for the maximum height.
    3. This command does not support 32-bit grayscale images.
  • This command does not support signed data images.

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         System.Windows.Freezable
            System.Windows.Media.Animation.Animatable
               System.Windows.Media.Effects.BitmapEffect
                  Leadtools.Windows.Media.Effects.RasterCommandBitmapEffect
                     Leadtools.Windows.Media.Effects.SpecialEffects.RevEffectCommandBitmapEffect

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, Windows Server 2003 family, Windows Server 2008 family

See Also