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





Converts the image from rectangular to polar coordinates and vice versa.

Syntax

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

PolarCommandBitmapEffect ...

Example

Visual BasicCopy Code
Public Sub PolarCommandBitmapEffectExample(ByVal element As FrameworkElement)
   Dim effect As PolarCommandBitmapEffect = New PolarCommandBitmapEffect()
   effect.Flags = PolarCommandBitmapEffectsFlags.Color
   effect.FillColor = Color.FromRgb(255, 0, 0)
   element.BitmapEffect = effect

   Dim animation1 As ColorAnimation = New ColorAnimation()
   animation1.From = Color.FromRgb(0, 255, 0)
   animation1.To = Color.FromRgb(255, 0, 0)
   animation1.By = Color.FromRgb(1, 1, 1)
   animation1.Duration = New Duration(TimeSpan.FromSeconds(4.0))
   animation1.AutoReverse = True
   animation1.RepeatBehavior = RepeatBehavior.Forever
   ' Initialize and run Storyboard
   Dim storyboard As Storyboard = New Storyboard()
   storyboard.SetTargetName(animation1, "AnimatedBitmapEffect")
   storyboard.SetTargetProperty(animation1, New PropertyPath(PolarCommandBitmapEffect.FillColorProperty))
   element.RegisterName("AnimatedBitmapEffect", effect)
   storyboard.Children.Add(animation1)
   storyboard.Begin(element)
End Sub
C#Copy Code
public void PolarCommandBitmapEffectExample(FrameworkElement element) 

   PolarCommandBitmapEffect effect = new PolarCommandBitmapEffect(); 
   effect.Flags = PolarCommandBitmapEffectsFlags.Color; 
   effect.FillColor = Color.FromRgb(255, 0, 0); 
   element.BitmapEffect = effect; 
 
   ColorAnimation animation1 = new ColorAnimation(); 
   animation1.From = Color.FromRgb(0, 255, 0); 
   animation1.To = Color.FromRgb(255, 0, 0); 
   animation1.By = Color.FromRgb(1, 1, 1); 
   animation1.Duration = new Duration(TimeSpan.FromSeconds(4.0)); 
   animation1.AutoReverse = true; 
   animation1.RepeatBehavior = RepeatBehavior.Forever; 
   // Initialize and run Storyboard 
   Storyboard storyboard = new Storyboard(); 
   Storyboard.SetTargetName(animation1, "AnimatedBitmapEffect"); 
   Storyboard.SetTargetProperty(animation1, new PropertyPath(PolarCommandBitmapEffect.FillColorProperty)); 
   element.RegisterName("AnimatedBitmapEffect", effect); 
   storyboard.Children.Add(animation1); 
   storyboard.Begin(element); 
}
XAMLCopy Code
<!-- Couldn't complete because I don't know how to animate with enums. --> 
<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:PolarCommandBitmapEffect x:Name="AnimatedBitmapEffect" Flags="Color" FillColor="White" /> 
      </Image.BitmapEffect> 
      <Image.Triggers> 
        <EventTrigger RoutedEvent="Image.Loaded"> 
          <BeginStoryboard> 
            <Storyboard> 
              <ColorAnimation Storyboard.TargetName="AnimatedBitmapEffect" Storyboard.TargetProperty="FillColor" From="White" To="Black" Duration="0:0:5" RepeatBehavior="Forever" AutoReverse="True" /> 
            </Storyboard> 
          </BeginStoryboard> 
        </EventTrigger> 
      </Image.Triggers> 
    </Image> 
  </Grid> 
</Page>

Remarks

WPF|Windows Presentation Foundation|Bitmaps|Effects|Artistic effects
  • This command converts an image from Cartesian (rectangular) coordinates to polar coordinates or vice versa. Rectangular coordinates use the form (x, y) where ‘x’ and ‘y’ are the horizontal and vertical distances from the origin, respectively. Polar coordinates are in the form (r, E) where ‘r’ is the distance from the origin to the point and ‘E’ is the angle of the line the point makes with the positive x-axis. Polar coordinates use a grid made of concentric circles around the origin, along with lines that are rays radiating outward from the origin.
  • This command considers the positions of the image’s pixels as values in a polar coordinate system. Then it converts all the pixels in a line of the image into a circle around the center of the image.
  • 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.PolarCommandBitmapEffect

Requirements

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

See Also

Reference

PolarCommandBitmapEffect Members
Leadtools.Windows.Media.Effects.SpecialEffects Namespace
AddNoiseCommandBitmapEffect Class
EmbossCommandBitmapEffect Class
MosaicCommandBitmapEffect Class
MotionBlurCommandBitmapEffect Class
OilifyCommandBitmapEffect Class
PosterizeCommandBitmapEffect Class
SolarizeCommandBitmapEffect Class
BendCommandBitmapEffect Class
CylinderCommandBitmapEffect Class
FreeHandShearCommandBitmapEffect Class
FreeHandWaveCommandBitmapEffect Class
PixelateCommandBitmapEffect Class
ImpressionistCommandBitmapEffect Class
PolarCommandBitmapEffect Class
RadialBlurCommandBitmapEffect Class
RadialWaveCommandBitmapEffect Class
RippleCommandBitmapEffect Class
SphereCommandBitmapEffect Class
SwirlCommandBitmapEffect Class
WaveCommandBitmapEffect Class
WindCommandBitmapEffect Class
ZoomBlurCommandBitmapEffect Class
ZoomWaveCommandBitmapEffect Class
CubismCommandBitmapEffect Class
DrawStarCommandBitmapEffect Class
DryCommandBitmapEffect Class
FreePlaneBendCommandBitmapEffect Class
FreeRadialBendCommandBitmapEffect Class
GlassEffectCommandBitmapEffect Class
GlowCommandBitmapEffect Class
LensFlareCommandBitmapEffect Class
OceanCommandBitmapEffect Class
PlaneBendCommandBitmapEffect Class
PlaneCommandBitmapEffect Class
SampleTargetCommandBitmapEffect Class
TunnelCommandBitmapEffect Class
BricksTextureCommandBitmapEffect Class
CloudsCommandBitmapEffect Class
ColoredBallsCommandBitmapEffect Class
DiffuseGlowCommandBitmapEffect Class
FragmentCommandBitmapEffect Class
HalfTonePatternCommandBitmapEffect Class
MaskConvolutionCommandBitmapEffect Class
MosaicTilesCommandBitmapEffect Class
PerspectiveCommandBitmapEffect Class
PlasmaCommandBitmapEffect Class
PointillistCommandBitmapEffect Class
RomanMosaicCommandBitmapEffect Class
VignnetCommandBitmapEffect Class
ZigZagCommandBitmapEffect Class