Christian Memije Christian Memije - 5 months ago 51x
Javascript Question

Set an image to fill the canvas using Paper.js

I have an image that has the same aspect ratio as the canvas but a different resolution. I know I can make use of the view size,

, but my trouble is setting the dimensions of the image. I have tried setting the width using
raster.width = 2000;
, for example, but it does not seem to work.


This ended up working for me.

raster.size = paper.view.viewSize;
raster.position =;