【发布时间】:2014-03-07 02:32:15
【问题描述】:
有没有办法在不裁剪的情况下加载更大或更小的图像?我不希望它看起来更小或更大。我希望它实际上更小或更大。我尝试将these parameters 用于新的 Image() 对象,还有吗?
_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);
【问题讨论】:
-
转到这个答案:可能的答案stackoverflow.com/questions/747101/…
标签: javascript jquery image object