Image
The ImageClip renders a static image on the canvas. Use it for photos, logos, or any non-animated visual asset.
Create an Image Clip
Runnable example
Idle
const mediaId = await Engine.getInstance()
.getLibrary()
.addMedia(
"https://images.pexels.com/photos/24253539/pexels-photo-24253539/free-photo-of-a-bridge-over-a-river-with-a-city-in-the-background.jpeg?auto=compress&cs=tinysrgb&w=1600",
);
const clip = await layer.addClip({
mediaDataId: mediaId,
startTime: 0,
duration: 5,
});
clip.style.setPosition(960, 540);
clip.style.setScale(0.6, 0.6); Full runnable example
import { Engine } from "@rendley/sdk";
await Engine.getInstance().init({
license: {
licenseName: "DOCS_PLAYGROUND",
licenseKey: "DOCS_KEY",
},
display: {
width: 1920,
height: 1080,
backgroundColor: "#000000",
view: document.getElementById("rendley-canvas") as HTMLCanvasElement,
},
});
const layer = Engine.getInstance().getTimeline().createLayer();
const mediaId = await Engine.getInstance()
.getLibrary()
.addMedia(
"https://images.pexels.com/photos/24253539/pexels-photo-24253539/free-photo-of-a-bridge-over-a-river-with-a-city-in-the-background.jpeg?auto=compress&cs=tinysrgb&w=1600",
);
const clip = await layer.addClip({
mediaDataId: mediaId,
startTime: 0,
duration: 5,
});
clip.style.setPosition(960, 540);
clip.style.setScale(0.6, 0.6);
await Engine.getInstance().getTimeline().play(); Loading The first run downloads the Rendley SDK from the CDN. Later runs reuse the cached copy and start instantly.
List of Supported Formats
| Format | Support |
|---|---|
| JPEG | ✅ |
| PNG | ✅ |
| GIF | ✅ |
| WEBP | ✅ |
| BMP | ✅ |
| HEIC | ✅ |
See Also
- Gif
- Svg
- Crop and Zoom
- Clip API Reference
- API reference:
ImageClip