Visual Basic (Declaration) | |
---|---|
Public Class RotateCommandBitmapEffect Inherits RasterCommandBitmapEffect |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public class RotateCommandBitmapEffect : RasterCommandBitmapEffect |
C++/CLI | |
---|---|
public ref class RotateCommandBitmapEffect : public RasterCommandBitmapEffect |
XAML Property Element Usage | |
---|---|
RotateCommandBitmapEffect ... |
XAML Property Element Usage | |
---|---|
RotateCommandBitmapEffect ... |
This example will load an image, rotate it by 45 degrees then save it back to disk
Visual Basic | Copy Code |
---|---|
Public Sub RotateCommandBitmapEffectExample(ByVal element As FrameworkElement) |
C# | Copy Code |
---|---|
public void RotateCommandBitmapEffectExample(FrameworkElement element) |
XAML | Copy 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;assembly=Leadtools.Windows.Media.Effects"> |
This command has the following features:
It uses the center of the image as the center of rotation. It can rotate the image clockwise or counterclockwise up to 360 degrees in 1-degree increments. It can resize the image to accommodate the rotated height and width, or it can retain the original height and width, cropping the image as necessary. It uses FillColor as the background color to fill any new area created by the rotation.
RotateCommandBitmapEffectsFlags.Resample and RotateCommandBitmapEffectsFlags.Bicubic can be combined with RotateCommandBitmapEffectsFlags.Resize, but they can not be combined with each other.
If RotateCommandBitmapEffectsFlags.Resize is set, then the image is resized. Otherwise, the image is cropped.
Interpolation can be done while rotating certain images. This produces superior output, eliminating the jaggedness occurring when rotating images at angles that are not multiple of 90. (ie when RotateCommandBitmapEffect.Angle is not a multiple of 9000).
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.RotateCommandBitmapEffect
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, Windows Server 2003 family, Windows Server 2008 family