Làm việc với Animation -- Aspose.Slides FOSS cho Python
Aspose.Slides FOSS for Python provides classes for working with working with animation.
Tổng quan
Các lớp học chính liên quan là:
IAnimationTimeLineAfterAnimationTypeAnimationTimeLineITextAnimationITextAnimationCollection
bắt đầu
Cài đặt Aspose.Slides FOSS cho Python:
pip install aspose-slides-fossSử dụng cơ bản
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)Mẹo và Thực hành Tốt nhất
- Luôn loại bỏ các tài liệu đối tượng sau khi sử dụng
- Chăm sóc các ngoại lệ I/O khi đọc hoặc viết tệp
- Kiểm tra The API tham chiếu Đối với các chữ ký mới nhất
Tóm tắt Tham chiếu API
| Class | Description |
|---|---|
IAnimationTimeLine | Xem các tài liệu tham khảo |
AfterAnimationType | Xem các tài liệu tham khảo |
AnimationTimeLine | Xem các tài liệu tham khảo |
ITextAnimation | Xem các tài liệu tham khảo |
ITextAnimationCollection | Xem các tài liệu tham khảo |
Để biết chi tiết, xem các API tham chiếu.