PAG官网 | PAG动效

PAG官网 | PAG动效

  • 首页
  • 产品
  • 功能
  • 文档
  • 案例
  • CN
  • GitHub
  • 论坛交流
  • 免费下载
  • Languages iconCN
    • EN

›导出插件

了解 PAG

  • Introduction
  • FAQs

快速开始

  • Install PAGViewer
  • Install PAGExporter
  • Export PAG Files
  • SDK Integration

导出插件

  • Use Configuration Panel
  • Use Exporting Panel
  • Export BMP Compositions
  • Config Fill Modes
  • Config Time Stretch Modes
  • Exporting Shortcut Keys
  • Error Code
  • Auto Detection Rules
  • Text Editing Rules
  • Add Text Background
  • Export Audio
  • Manually Install PAGExporter

预览工具

  • Preview Replacements
  • View File Structure
  • Preview Shortcut Keys
  • Export Image Sequence
  • File Encryption
  • Add Watermark
  • Upgrade to Beta Version

性能优化

  • Use Performance Panel
  • PAG File Optimization

移动端进阶

  • Common API Overview
  • Use PAGImageView
  • Video Replacement
  • Play Audio
  • Text Layer Description
  • Use Encripted File
  • Export To Video
  • SDK Authentication

Web 进阶

  • SDK Installation
  • Load PAG File
  • Play PAG File
  • Platform Capabilities
  • Use WebWorker

API 参考

  • API Document

视频教程

  • PAG Workflow
  • File Optimization Best Practices
  • Use PAGExporter Panel
  • PAG Online Q&A

资源下载

  • PAGViewer Installer
  • PAG Test Files
  • PAG Demo Projects
  • China LiveVideoStackCon2022
  • PAG Conversion Tool
  • PAG File Format Spec

TAVMedia

  • Introduction to TAVMedia
  • TAVMedia Quick access
  • Common API Overview

其他

  • From Lottie To PAG
  • PAG Dictionary

Config Fill Modes


填充模式使用场景

PAG 填充模式主要使用在以下两种场景:

  1. 当渲染的尺寸(PAGView、PAGSurface 大小)和 pag 文件的尺寸不一致时
  2. 当 pag 文件中 占位图 的尺寸和填充图片尺寸不一致时

填充模式的效果

PAG 支持以下几种填充模式:

  • None:不缩放,左上角位置开始裁剪

  • LetterBox:黑边,在保持高宽比的情况下缩放到设备的可用屏幕大小,图像不发生变形,如果图片尺寸和填充区域比例不一致,会出现黑边,为默认填充模式

  • Stretch:拉伸,不保持宽高比填充,会发生失变形

  • Zoom:裁剪,在保持高宽比的情况下缩放到完全填满可用的屏幕大小

填充模式的设置方法

导出面板中设置

占位图 的填充模式可以在 AE 导出面板中设置

API 设置

可以在 PAGView、PAGImageView、PAGPlayer、PAGImage 中通过以下方法设置

- (void)setScaleMode:(PAGScaleMode)value

iOS 平台的 PAGImageView 通过系统自带的 contentMode 方法

@property(nonatomic) UIViewContentMode contentMode;

如果以上填充模式不满足需求,支持设置 PAG 渲染内容或填充图片的 Matrix, 通过以下接口

// iOS
- (void)setMatrix:(CGAffineTransform)value;

// Android
void setMatrix(Matrix matrix);

← Export BMP CompositionsConfig Time Stretch Modes →
  • 填充模式使用场景
  • 填充模式的效果
    • PAG 支持以下几种填充模式:
  • 填充模式的设置方法
    • 导出面板中设置
    • API 设置
Address: Tencent Binhai Building, No. 33 Haitian Second Road, Nanshan District, Shenzhen, Guangdong Province, China.
TEL: 0755-86013388
QQ Group: 893379574
Copyright © 2018 - 2025 Tencent. All Rights Reserved.
Privacy Policy
公司地址:广东省深圳市南山区海天二路33号腾讯滨海大厦
联系电话:0755-86013388
QQ群:893379574
Copyright © 2018 - 2025 Tencent. All Rights Reserved.
隐私政策
Copyright © 2018 - 2025 Tencent. All Rights Reserved.
Address: Tencent Binhai Building, No. 33 Haitian Second Road, Nanshan District, Shenzhen, Guangdong Province, China.
TEL: 0755-86013388
QQ Group: 893379574
Privacy Policy
Copyright © 2018 - 2025 Tencent. All Rights Reserved.
公司地址:广东省深圳市南山区海天二路33号腾讯滨海大厦
联系电话:0755-86013388
QQ群:893379574
隐私政策