2014-03-07 29 views
0

有沒有辦法在不裁剪的情況下加載更大或更小的圖像?我不希望它看起來更小或更大。我希望它實際上更小或更大。我嘗試使用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); 
+0

去這樣的回答:可能的答案HTTP ://stackoverflow.com/questions/747101/resize-crop-pad-a-picture-to-a-fixed-size – airi

回答