fromElement
API reference for the "fromElement" method.
const { imageHelpers } = window.canva;
const canva = window.canva.init();
canva.onReady(async (opts) => {
// Convert a CanvaElement into a CanvaImageBlob
const image = await imageHelpers.fromElement(opts.element);
// Do something with the result
console.log(image);
});
Name | Type | Required | Description |
---|---|---|---|
element | CanvaElement | Yes | The CanvaElement to convert into a CanvaImageBlob . |
quality | string | No | The quality of the image. The possible values are "thumbnail" , "preview" , and "full" . The default value is "full" . |
Promise<CanvaImageBlob | undefined>
Last modified 1yr ago