Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How to increase the height of an image created using putImagedata?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #45772
    PSP
    Participant

    Is there any way to increase the height of image created using HTML5 canvas putImagedata.


    Your browser does not support the HTML5 canvas tag.


    #139993
    pixelgrid
    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

    #140043
    PSP
    Participant

    Thank you, but it is not taking 5 arguements. Tried it.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.