S
S
starkos2015-12-29 10:21:15
JavaScript
starkos, 2015-12-29 10:21:15

Saving a large image from canvas?

There is a js script for loading and manipulating an image using the fabricjs library. The dimensions of the canvas are 600x350 pixels. If I upload a smaller image to the canvas, and then save it from the canvas to a file on the computer's disk, then everything is fine. But when I upload an image to the canvas that is larger than the size of the canvas (viewport) and then save the file to disk, the image for some reason crops to the size of the canvas.
Can you please tell me how to save an image from the canvas that is larger than the size of the canvas?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2015-12-30
@xmoonlight

Through the canvas object in memory.

S
SnowElephant, 2015-12-31
@SnowElephant

The image is cropped even when drawing on the canvas. I propose to dynamically set the size of the canvas to the size of the image.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question