Skip to content Skip to sidebar Skip to footer

Resize Canvas After Scale Image

I'm trying to scale an image that has already been draw into canvas.I using this answer for draw/rotate image in canvas.This sample work fine for me and resize canvase correctly .

Solution 1:

You can resize then canvas to scale by multiplying the canvas size by your currentScale:

canvas.width = size.width*currentScale;
canvas.height = size.height*currentScale;

Post a Comment for "Resize Canvas After Scale Image"