AddEffect

AddEffect(IShape, EffectType, EffectSubtype, EffectTriggerType)

在序列末尾添加新效果。

public IEffect AddEffect(IShape shape, EffectType effectType, EffectSubtype subtype, 
    EffectTriggerType triggerType)
参数类型描述
shapeIShape要添加效果的形状对象 IShape
effectTypeEffectType动画效果的类型 EffectType
subtypeEffectSubtype动画效果的子类型 EffectSubtype
triggerTypeEffectTriggerType效果的触发类型 EffectTriggerType

返回值

新效果对象 IEffect

另请参阅


AddEffect(IParagraph, EffectType, EffectSubtype, EffectTriggerType)

在序列末尾为段落添加新动画效果。

public IEffect AddEffect(IParagraph paragraph, EffectType effectType, EffectSubtype subtype, 
    EffectTriggerType triggerType)
参数类型描述
paragraphIParagraph段落对象 IParagraph
effectTypeEffectType动画效果的类型 EffectType
subtypeEffectSubtype动画效果的子类型 EffectSubtype
triggerTypeEffectTriggerType效果的触发类型 EffectTriggerType

返回值

新效果对象 IEffect

示例

[C#]
using(Presentation presentation = new Presentation(path + "input.pptx"))
{        
   // 选择要添加效果的段落
   IAutoShape autoShape = (IAutoShape)presentation.Slides[0].Shapes[0];
   IParagraph paragraph = autoShape.TextFrame.Paragraphs[0];

   // 为所选段落添加飞入动画效果
   IEffect effect = presentation.Slides[0].Timeline.MainSequence.AddEffect(
   paragraph, EffectType.Fly, EffectSubtype.Left, EffectTriggerType.OnClick);
}

另请参阅


AddEffect(IChart, EffectChartMajorGroupingType, int, EffectType, EffectSubtype, EffectTriggerType)

为类别或系列在序列末尾添加新的图表动画效果。

public IEffect AddEffect(IChart chart, EffectChartMajorGroupingType type, int index, 
    EffectType effectType, EffectSubtype subtype, EffectTriggerType triggerType)
参数类型描述
chartIChart图表对象 IChart
typeEffectChartMajorGroupingType动画效果的类型 EffectChartMinorGroupingType
indexInt32Index Int32
effectTypeEffectType动画效果的类型 EffectType
subtypeEffectSubtype动画效果的子类型 EffectSubtype
triggerTypeEffectTriggerType效果的触发类型 EffectTriggerType

返回值

新效果对象 IEffect

另请参阅


AddEffect(IChart, EffectChartMinorGroupingType, int, int, EffectType, EffectSubtype, EffectTriggerType)

为类别或系列中的元素在序列末尾添加新的图表动画效果。

public IEffect AddEffect(IChart chart, EffectChartMinorGroupingType type, int seriesIndex, 
    int categoriesIndex, EffectType effectType, EffectSubtype subtype, 
    EffectTriggerType triggerType)
参数类型描述
chartIChart图表对象 IChart
typeEffectChartMinorGroupingType动画效果的类型 EffectChartMinorGroupingType
seriesIndexInt32图表系列的索引 Int32
categoriesIndexInt32类别的索引 Int32
effectTypeEffectType动画效果的类型 EffectType
subtypeEffectSubtype动画效果的子类型 EffectSubtype
triggerTypeEffectTriggerType效果的触发类型 EffectTriggerType

返回值

新效果对象 IEffect

另请参阅