Leadtools.Windows.Media.Effects Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.02.15
PlasmaCommandBitmapEffect Class
See Also  Members   Example 
Leadtools.Windows.Media.Effects.SpecialEffects Namespace : PlasmaCommandBitmapEffect Class





Applies color patterns that blend into each other like plasma.

Syntax

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

PlasmaCommandBitmapEffect ...

Example

Visual BasicCopy Code
Public Sub PlasmaCommandBitmapEffectExample(ByVal element As FrameworkElement)
   Dim effect As PlasmaCommandBitmapEffect = New PlasmaCommandBitmapEffect()
   effect.Flags = PlasmaCommandBitmapEffectsFlags.Rgb1 Or PlasmaCommandBitmapEffectsFlags.Cross
   effect.Shift = 0
   effect.Size = 2000
   effect.Opacity = 70
   effect.RedFrequency = 2000
   effect.GreenFrequency = 0
   effect.BlueFrequency = 6000
   element.BitmapEffect = effect

   Dim storyboard As Storyboard = New Storyboard()

   Dim animation1 As Int32Animation = New Int32Animation()
   animation1.From = 0
   animation1.To = 255
   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(PlasmaCommandBitmapEffect.ShiftProperty))
   element.RegisterName("AnimatedBitmapEffect", effect)
   storyboard.Children.Add(animation1)

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

   PlasmaCommandBitmapEffect effect = new PlasmaCommandBitmapEffect(); 
   effect.Flags = PlasmaCommandBitmapEffectsFlags.Rgb1 | PlasmaCommandBitmapEffectsFlags.Cross; 
   effect.Shift = 0; 
   effect.Size = 2000; 
   effect.Opacity = 70; 
   effect.RedFrequency = 2000; 
   effect.GreenFrequency = 0; 
   effect.BlueFrequency = 6000; 
   element.BitmapEffect = effect; 
 
   Storyboard storyboard = new Storyboard(); 
 
   Int32Animation animation1 = new Int32Animation(); 
   animation1.From = 0; 
   animation1.To = 255; 
   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(PlasmaCommandBitmapEffect.ShiftProperty)); 
   element.RegisterName("AnimatedBitmapEffect", effect); 
   storyboard.Children.Add(animation1); 
 
   storyboard.Begin(element); 
}
XAMLCopy Code
<Page Title="CSAnimateEffect" Height="391" Width="300" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:lteffects="clr-namespace:Leadtools.Windows.Media.Effects.SpecialEffects;assembly=Leadtools.Windows.Media.Effects"> 
  <Grid> 
    <Image Margin="10,10,10,10" HorizontalAlignment="Center" VerticalAlignment="Center" Source="C:\Program Files\LEAD Technologies, Inc\LEADTOOLS 15\Images\slave.jpg"> 
      <Image.BitmapEffect> 
        <lteffects:PlasmaCommandBitmapEffect x:Name="AnimatedBitmapEffect" Flags="Rgb1, Cross" Shift="0" Size="2000" Opacity="70" /> 
      </Image.BitmapEffect> 
      <Image.Triggers> 
        <EventTrigger RoutedEvent="Image.Loaded"> 
          <BeginStoryboard> 
            <Storyboard> 
              <Int32Animation Storyboard.TargetName="AnimatedBitmapEffect" Storyboard.TargetProperty="Shift" From="0" To="255" Duration="0:0:5" RepeatBehavior="Forever" AutoReverse="true" /> 
            </Storyboard> 
          </BeginStoryboard> 
        </EventTrigger> 
      </Image.Triggers> 
    </Image> 
  </Grid> 
</Page>

Remarks

  • As an example, suppose you call the PlasmaCommandBitmapEffect method, using an Opacity value of 0, which means that no image is to be used, and you use the following settings:
    ParametersValue
    Shift0
    Opacity0
    Size1000
    FlagsRandom1 | Rgb1

    The following figure results:

  • The Opacity value will always be considered to be 0, unless specified otherwise by a value between (and including) 0 to 100.
  • Use the RedFrequency, GreenFrequency, and BlueFrequency to create a custom color pattern. To use them, pass the CustomColor flag to PlasmaCommandBitmapEffect. Otherwise, their values will be ignored.
  • The Hue value is a predefined color pattern that is based on the HLS color space. It creates plasma patterns by changing hue values.
  • The Rgb1 value is a predefined color pattern that is based on the RGB color space. Different combinations of red, green and blue frequencies produce different results.
  • Like the Rgb1 value, the Rgb2 value is based on the RGB color space, but uses a different combination of red, green and blue frequencies.
  • The color palette used for Shift is a continuous cylindrical color palette. In the following figures, one shows where on the palette a value of 0 lies, and the other one shows where on the palette the maximum value lies:
  • 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.PlasmaCommandBitmapEffect

Requirements

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

See Also