Home › Forums › JavaScript › How to increase the height of an image created using putImagedata? › Re: How to increase the height of an image created using putImagedata?
June 23, 2013 at 4:10 pm
#139993
Participant
put image data accepts up to 5 arguements.
if you use it like this
ctx.putImageData(imgData,10,70);
it will paint imgData to the canvas the top left point being (10,70);
if you use it like this
ctx.putImageData(imgData,10,70,50,50);
the imgData will be painted from (x,y) = (10,70) and its width and height being 50 each.
this operation scales the image but if you choose different height than width depending on the img aspect ratio it will strech it to fit the area you defined