menu

ASP.NET MVC

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface IMotionEffect

    Show / Hide Table of Contents

    Interface IMotionEffect

    Represents the motion effect.

    Inherited Members
    IBehavior.Accumulate
    IBehavior.Additive
    IBehavior.Properties
    IBehavior.Timing
    Namespace: Syncfusion.Presentation
    Assembly: Syncfusion.Presentation.Base.dll
    Syntax
    public interface IMotionEffect : IBehavior

    Properties

    Angle

    Get the Angle value from the motion animation effect.

    Declaration
    float Angle { get; set; }
    Property Value
    Type Description
    System.Single
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IMotionEffect)
    {
    // Assign the motion effect values
    IMotionEffect motionEffect = (behavior as IMotionEffect);
    motionEffect.Angle = 0;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is motion effect
    If (TypeOf behavior Is MotionEffect) Then
    'Assign the motion effect values
    Dim motionEffect As MotionEffect = TryCast(behavior,MotionEffect)
    motionEffect.Angle = 0
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    By

    Get the By value of motion effect

    Declaration
    PointF By { get; set; }
    Property Value
    Type Description
    System.Drawing.PointF
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IMotionEffect)
    {
    // Assign the motion effect values
    IMotionEffect motionEffect = (behavior as IMotionEffect);
    PointF byValue = motionEffect.By;
    byValue.X = 400;
    byValue.Y = 500;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is motion effect
    If (TypeOf behavior Is MotionEffect) Then
    'Assign the motion effect values
    Dim motionEffect As MotionEffect = TryCast(behavior,MotionEffect)
    Dim byValue As PointF = motionEffect.By
    byValue.X = 400
    byValue.Y = 500
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    From

    Get the from value of motion effect

    Declaration
    PointF From { get; set; }
    Property Value
    Type Description
    System.Drawing.PointF
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IMotionEffect)
    {
    // Assign the motion effect values
    IMotionEffect motionEffect = (behavior as IMotionEffect);
    PointF fromValue = motionEffect.From;
    fromValue.X = 400;
    fromValue.Y = 500;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is motion effect
    If (TypeOf behavior Is MotionEffect) Then
    'Assign the motion effect values
    Dim motionEffect As MotionEffect = TryCast(behavior,MotionEffect)
    Dim fromValue As PointF = motionEffect.From
    fromValue.X = 400
    fromValue.Y = 500
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    Origin

    Get the origin type of motion effect

    Declaration
    MotionOriginType Origin { get; set; }
    Property Value
    Type Description
    MotionOriginType
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IMotionEffect)
    {
    // Assign the motion effect values
    IMotionEffect motionEffect = (behavior as IMotionEffect);
    motionEffect.Origin = MotionOriginType.Layout;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is motion effect
    If (TypeOf behavior Is MotionEffect) Then
    'Assign the motion effect values
    Dim motionEffect As MotionEffect = TryCast(behavior,MotionEffect)
    motionEffect.Origin = MotionOriginType.Layout
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    Path

    Get the path value of the motion effect

    Declaration
    IMotionPath Path { get; }
    Property Value
    Type Description
    IMotionPath
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IMotionEffect)
    {
    // Assign the motion effect values
    IMotionEffect motionEffect = (behavior as IMotionEffect);
    IMotionPath path = (motionEffect.Path as IMotionPath);
    path[0].CommandType = MotionCommandPathType.MoveTo;
    path[0].IsRelative = false;
    path[0].PointsType = MotionPathPointsType.Auto;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is motion effect
    If (TypeOf behavior Is MotionEffect) Then
    'Assign the motion effect values
    Dim motionEffect As MotionEffect = TryCast(behavior,MotionEffect)
    Dim path As MotionPath = TryCast(motionEffect.Path, MotionPath)
    path(0).CommandType = MotionCommandPathType.MoveTo;
    path(0).IsRelative = false;
    path(0).PointsType = MotionPathPointsType.Auto;
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    PathEditMode

    Get the path edit mode of motion effect

    Declaration
    MotionPathEditMode PathEditMode { get; set; }
    Property Value
    Type Description
    MotionPathEditMode
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IMotionEffect)
    {
    // Assign the motion effect values
    IMotionEffect motionEffect = (behavior as IMotionEffect);
    motionEffect.PathEditMode = MotionPathEditMode.Relative;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is motion effect
    If (TypeOf behavior Is MotionEffect) Then
    'Assign the motion effect values
    Dim motionEffect As MotionEffect = TryCast(behavior,MotionEffect)
    motionEffect.PathEditMode = MotionPathEditMode.Relative
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    RotationCenter

    Get the rotation center value of motion effect

    Declaration
    PointF RotationCenter { get; set; }
    Property Value
    Type Description
    System.Drawing.PointF
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IMotionEffect)
    {
    // Assign the motion effect values
    IMotionEffect motionEffect = (behavior as IMotionEffect);
    PointF rotationValue = motionEffect.RotationCenter;
    rotationValue.X = 400;
    rotationValue.Y = 500;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is motion effect
    If (TypeOf behavior Is MotionEffect) Then
    'Assign the motion effect values
    Dim motionEffect As MotionEffect = TryCast(behavior,MotionEffect)
    Dim rotationValue As PointF = motionEffect.RotationCenter
    rotationValue.X = 400
    rotationValue.Y = 500
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    To

    Get the To value of motion effect

    Declaration
    PointF To { get; set; }
    Property Value
    Type Description
    System.Drawing.PointF
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IMotionEffect)
    {
    // Assign the motion effect values
    IMotionEffect motionEffect = (behavior as IMotionEffect);
    PointF toValue = motionEffect.To;
    toValue.X = 400;
    toValue.Y = 500;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.PathCrescentMoon, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is motion effect
    If (TypeOf behavior Is MotionEffect) Then
    'Assign the motion effect values
    Dim motionEffect As MotionEffect = TryCast(behavior,MotionEffect)
    Dim toValue As PointF = motionEffect.To
    toValue.X = 400
    toValue.Y = 500
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved