Converts ImageData to a PNG Blob and writes it to the system clipboard. This is a high-level utility that combines imageDataToImgBlob and writeImgBlobToClipboard.
The image data to copy to the clipboard.
A promise that resolves when the image has been successfully copied.
If the conversion to blob fails or clipboard permissions are denied.
const canvas = document.querySelector('canvas')const ctx = canvas.getContext('2d')const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height)await writeImageDataToClipboard(imageData) Copy
const canvas = document.querySelector('canvas')const ctx = canvas.getContext('2d')const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height)await writeImageDataToClipboard(imageData)
Converts ImageData to a PNG Blob and writes it to the system clipboard. This is a high-level utility that combines imageDataToImgBlob and writeImgBlobToClipboard.