本文整理汇总了C#中PowerPointLabs.Models.PowerPointSlide.DeleteShapeAnimations方法的典型用法代码示例。如果您正苦于以下问题:C# PowerPointSlide.DeleteShapeAnimations方法的具体用法?C# PowerPointSlide.DeleteShapeAnimations怎么用?C# PowerPointSlide.DeleteShapeAnimations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PowerPointLabs.Models.PowerPointSlide
的用法示例。
在下文中一共展示了PowerPointSlide.DeleteShapeAnimations方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddFrameAnimationEffects
private static void AddFrameAnimationEffects(PowerPointSlide animationSlide, PowerPoint.Shape initialShape, float incrementLeft, float incrementTop, float incrementWidth, float incrementHeight, float incrementRotation ,float incrementFont, float duration, int numFrames)
{
PowerPoint.Shape lastShape = initialShape;
PowerPoint.Sequence sequence = animationSlide.TimeLine.MainSequence;
for (int i = 1; i <= numFrames; i++)
{
PowerPoint.Shape dupShape = initialShape.Duplicate()[1];
if (i != 1 && animationType != FrameMotionAnimationType.kZoomToAreaDeMagnify)
sequence[sequence.Count].Delete();
if (animationType == FrameMotionAnimationType.kInSlideAnimate || animationType == FrameMotionAnimationType.kZoomToAreaPan || animationType == FrameMotionAnimationType.kZoomToAreaDeMagnify)
animationSlide.DeleteShapeAnimations(dupShape);
if (animationType == FrameMotionAnimationType.kZoomToAreaPan)
dupShape.Name = "PPTLabsMagnifyPanAreaGroup" + DateTime.Now.ToString("yyyyMMddHHmmssffff");
dupShape.LockAspectRatio = Office.MsoTriState.msoFalse;
dupShape.Left = initialShape.Left;
dupShape.Top = initialShape.Top;
if (incrementWidth != 0.0f)
dupShape.ScaleWidth((1.0f + (incrementWidth * i)), Office.MsoTriState.msoFalse, Office.MsoScaleFrom.msoScaleFromMiddle);
if (incrementHeight != 0.0f)
dupShape.ScaleHeight((1.0f + (incrementHeight * i)), Office.MsoTriState.msoFalse, Office.MsoScaleFrom.msoScaleFromMiddle);
if (incrementRotation != 0.0f)
dupShape.Rotation += (incrementRotation * i);
if (incrementLeft != 0.0f)
dupShape.Left += (incrementLeft * i);
if (incrementTop != 0.0f)
dupShape.Top += (incrementTop * i);
if (incrementFont != 0.0f)
dupShape.TextFrame.TextRange.Font.Size += (incrementFont * i);
if (i == 1 && (animationType == FrameMotionAnimationType.kInSlideAnimate || animationType == FrameMotionAnimationType.kZoomToAreaPan))
{
PowerPoint.Effect appear = sequence.AddEffect(dupShape, PowerPoint.MsoAnimEffect.msoAnimEffectAppear, PowerPoint.MsoAnimateByLevel.msoAnimateLevelNone, PowerPoint.MsoAnimTriggerType.msoAnimTriggerOnPageClick);
}
else
{
PowerPoint.Effect appear = sequence.AddEffect(dupShape, PowerPoint.MsoAnimEffect.msoAnimEffectAppear, PowerPoint.MsoAnimateByLevel.msoAnimateLevelNone, PowerPoint.MsoAnimTriggerType.msoAnimTriggerWithPrevious);
appear.Timing.TriggerDelayTime = ((duration / numFrames) * i);
}
PowerPoint.Effect disappear = sequence.AddEffect(lastShape, PowerPoint.MsoAnimEffect.msoAnimEffectAppear, PowerPoint.MsoAnimateByLevel.msoAnimateLevelNone, PowerPoint.MsoAnimTriggerType.msoAnimTriggerWithPrevious);
disappear.Exit = Office.MsoTriState.msoTrue;
disappear.Timing.TriggerDelayTime = ((duration / numFrames) * i);
lastShape = dupShape;
}
if (animationType == FrameMotionAnimationType.kInSlideAnimate || animationType == FrameMotionAnimationType.kZoomToAreaPan || animationType == FrameMotionAnimationType.kZoomToAreaDeMagnify)
{
PowerPoint.Effect disappearLast = sequence.AddEffect(lastShape, PowerPoint.MsoAnimEffect.msoAnimEffectAppear, PowerPoint.MsoAnimateByLevel.msoAnimateLevelNone, PowerPoint.MsoAnimTriggerType.msoAnimTriggerAfterPrevious);
disappearLast.Exit = Office.MsoTriState.msoTrue;
disappearLast.Timing.TriggerDelayTime = duration;
}
}
示例2: ProcessExistingHighlightSlide
//Delete existing animations
private static void ProcessExistingHighlightSlide(PowerPointSlide currentSlide, List<PowerPoint.Shape> shapesToUse)
{
currentSlide.DeleteIndicator();
currentSlide.DeleteShapesWithPrefix("PPTLabsHighlightBackgroundShape");
foreach (PowerPoint.Shape tmp in currentSlide.Shapes)
if (shapesToUse.Contains(tmp))
if (userSelection != HighlightTextSelection.kTextSelected)
currentSlide.DeleteShapeAnimations(tmp);
}
示例3: PrepareZoomShape
private static void PrepareZoomShape(PowerPointSlide currentSlide, ref PowerPoint.Shape selectedShape)
{
currentSlide.DeleteShapeAnimations(selectedShape);
RemoveTextFromShape(selectedShape);
selectedShape.Rotation = 0;
}
示例4: SelectOldShapesToAnimate
private static void SelectOldShapesToAnimate(PowerPointSlide currentSlide, List<PowerPoint.Shape> shapesToUse)
{
List<PowerPoint.Shape> shapesToDelete = new List<PowerPoint.Shape>();
bool shouldSelect;
var shapes = currentSlide.GetShapesOrderedByTimeline();
foreach (var sh in shapes)
{
shouldSelect = true; //We should not select existing highlight shapes. Instead they should be deleted
if (sh.Name.Contains("PPTLabsHighlightBackgroundShape"))
{
if (userSelection != HighlightBackgroundSelection.kTextSelected)
{
foreach (PowerPoint.Shape tmp in shapesToUse)
{
//Each highlight shape stores a tag of the shape it is associated with
if (sh.Tags["HighlightBackground"].Equals(tmp.Name))
{
shapesToDelete.Add(sh);
shouldSelect = false;
break;
}
}
}
if (shouldSelect)
{
currentSlide.DeleteShapeAnimations(sh);
sh.Select(Office.MsoTriState.msoFalse);
}
}
//Remove existing animations for highlight text as well
if (sh.Name.Contains("HighlightTextShape"))
currentSlide.DeleteShapeAnimations(sh);
}
if (shapesToDelete.Count > 0)
foreach (PowerPoint.Shape sh in shapesToDelete)
sh.Delete();
}