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:
IAnimationTimeLineAfterAnimationTypeAnimationTimeLineITextAnimationITextAnimationCollection
Kom igång
Installera Aspose.Slides FOSS för Python:
pip install aspose-slides-fossGrundlä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
| Klass | Beskrivning |
|---|---|
IAnimationTimeLine | Se referensdokument |
AfterAnimationType | Se referensdokument |
AnimationTimeLine | Se referensdokument |
ITextAnimation | Se referensdokument |
ITextAnimationCollection | Se referensdokument |
För fullständig information, se API Reference.