Web SDK Reference | Render preview
The renderPreview()
method can be called to render a preview image of the current 3D view.
JS
renderPreview(options, callback): void
Parameters
Name | Type | Description |
---|---|---|
options | | Rendering options.
JS
|
- |
| Callback function that is called when preview image is rendered. |
Example
JS
window.twikit.renderPreview(
{
backgroundColor: '#123422',
resolution: { height: 70, width: 100},
cameraState: { pitch: 30 /* deg */, yaw: 60 /* deg */, roll: 90 /* deg */, zoomDistance: 300 /* mm */ },
download?: { fileName: string } | boolean;
},
function(base64EncodedImageUrl) {
// Store image.
}
);