Properties
| Name | Type | Description |
|---|---|---|
| style? | ViewStyle | View style |
| ref? | Ref<SkiaView> | Reference to the SkiaView object |
| onSize? | SharedValue<Size> | Reanimated value to which the canvas size will be assigned |
| androidWarmup? | boolean | Draw the first frame directly on the Android compositor. Use for static icons or fully opaque drawings—animated or translucent canvases can misrender |
Canvas Size
The size of the canvas is available on both the UI and JS thread.UI Thread
TheonSize property receives a shared value that updates whenever the canvas size changes:
JS Thread
To get the canvas size on the JS thread, useuseLayoutEffect and measure(). We provide a useCanvasSize hook for convenience:
Getting a Canvas Snapshot
You can save your drawings as an image using themakeImageSnapshotAsync method. This returns a promise that resolves to an Image object. It executes on the UI thread, ensuring access to the same Skia context as your on-screen canvases, including textures.
If your drawing doesn’t contain textures, you can use the synchronous makeImageSnapshot method.