How is the resolution of a Canvas
element determined and can we explicitly set it?
#1413
-
<Canvas ref={canvasRef} style={{ width: 100, height: 100 }}>
{/* ... */}
</Canvas>
function ff () {
const { width, height, encodeToBase64 } = canvasRef.current!.makeImageSnapshot();
width() // = 300;
height() // = 300;
} Modifying the Is it(300x300) the size of the surface that the canvas belongs to? I found that there is a way to do it with offscreen surfaces, however, I can't find one for I'm developing an image editor component now. There is a preview of the image under manipulation and the user will get the same image after saving. So it is required to create a In the current situation, I should create a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@bglgwyng your best best is indeed offscreen to use the offscreen capabilities. Right it they are not available with the |
Beta Was this translation helpful? Give feedback.
@bglgwyng your best best is indeed offscreen to use the offscreen capabilities. Right it they are not available with the
Canvas
element but we will make it available in the short term, stay tuned there.