Open Dylan190774 opened 2 months ago
In devtools console I get the following warning:
Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See:
This happens when I use const result = this.$refs.cropper.getResult(); a few times after another and then do getImageData on the context of result.canvas
const result = this.$refs.cropper.getResult();
getImageData
result.canvas
Any idea how to set willReadFrequently on the canvas of getResult?
willReadFrequently
getResult
Found the solution, I just had to use :
const ctx = canvas.getContext('2d', { willReadFrequently: true }); when getting the context of the canvas.
const ctx = canvas.getContext('2d', { willReadFrequently: true });
In devtools console I get the following warning:
Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See:
https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequentlyThis happens when I use
const result = this.$refs.cropper.getResult();
a few times after another and then dogetImageData
on the context ofresult.canvas
Any idea how to set
willReadFrequently
on the canvas ofgetResult
?