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
indexInt32Int32 索引
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

另请参见