Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Scaling an image to fit on canvas

ctx.drawImage(img, 0, 0, img.width,    img.height,     // source rectangle
                   0, 0, canvas.width, canvas.height); // destination rectangle
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Scaling #image #fit #canvas
ADD COMMENT
Topic
Name
8+4 =