0

Is there a way to load an image larger or smaller without cropping? I don't want it to look smaller or larger. I want it to actually be smaller or larger. I tried using these parameters for a new Image() object, are there any more?    

_img = new Image(50, 50); //These parameters will crop it
_img.addEventListener('load',onImage,false);
_img.width = 50;//This will crop it.  

_img.style.width = "50px";//This doesn't change the original width to read `50`.  
console.log(_img.width);
Squirrl
  • 4,909
  • 9
  • 47
  • 85
  • go to this answer : possible answer http://stackoverflow.com/questions/747101/resize-crop-pad-a-picture-to-a-fixed-size – airi Mar 07 '14 at 02:35

1 Answers1

0

Even if your question is unclear, I think you have to use canvas to redraw it after on load...this answer might give you a direction Resizing a .png image when drawing to HTML5 canvas using JavaScript

Community
  • 1
  • 1
Jinxmcg
  • 1,830
  • 1
  • 21
  • 24