Christian Memije Christian Memije - 1 year ago 135
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.

Answer Source

This ended up working for me.

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