Arbeta med animation -- Aspose.Slides FOSS for Python

Aspose.Slides FOSS för Python tillhandahåller klasser för att arbeta med animation.


Översikt

De viktigaste klasserna är:

  • IAnimationTimeLine
  • AfterAnimationType
  • AnimationTimeLine
  • ITextAnimation
  • ITextAnimationCollection

Kom igång

Installera Aspose.Slides FOSS för Python:

pip install aspose-slides-foss

Grundläggande användning

import aspose.slides_foss as slides
from aspose.slides_foss import ShapeType
from aspose.slides_foss import animation as anim
from aspose.slides_foss.export import SaveFormat

with slides.Presentation() as prs:
    slide = prs.slides[0]
    shape = slide.shapes.add_auto_shape(ShapeType.RECTANGLE, 10, 10, 100, 50)
    effect = slide.timeline.main_sequence.add_effect(
        shape, anim.EffectType.FADE,
        anim.EffectSubtype.NONE,
        anim.EffectTriggerType.ON_CLICK,
    )
    prs.save("animated.pptx", SaveFormat.PPTX)

Tips och bästa praxis

  • Disposera alltid dokumentobjekt efter användning
  • Hantera fil-I/O-undantag när du läser eller skriver filer
  • Kontrollera API reference för de senaste signaturerna

API Reference Sammanfattning

KlassBeskrivning
IAnimationTimeLineSe referensdokument
AfterAnimationTypeSe referensdokument
AnimationTimeLineSe referensdokument
ITextAnimationSe referensdokument
ITextAnimationCollectionSe referensdokument

För fullständig information, se API Reference.

Se även

 Svenska