Inserting External Assets¶
JAnim supports inserting images or videos through ImageItem, VideoFrame, and Video, and can also use SVGItem to parse SVG vector graphics.
Inserting Images/Extracting Video Frames¶
ImageItem inserted images are displayed in the JAnim coordinate system at their original size by default. You can pass width and height parameters to specify the display size.
The width and height parameters represent sizes in the JAnim coordinate system. If only one parameter is specified, the other will be automatically calculated according to the image’s original aspect ratio, i.e., the image’s aspect ratio will be maintained.
VideoFrame extracts the frame at a specified time from a video and inserts it as an image. Other parameters are consistent with ImageItem.
Inserting Videos¶
You can use Video to insert videos. Parameter settings are basically consistent with ImageItem.
It also supports using the loop parameter to control whether to loop (useful for .gif format), and using frame_components=4 to insert videos with alpha channels (such as .mov videos).
For specific usage, refer to the Video documentation.
Inserting SVG Vector Graphics¶
SVGItem can parse SVG vector graphics and convert them into JAnim item groups.