图片缩放 小记
drawImage.jsfunction drawImage(ImgD, x, y) {var ratio = ImgD.width / ImgD.height;ImgD.width = ((ratio >= x/y) ? x : ratio * y);ImgD.height = ((ratio >= x/y) ? x/ratio : y);}
function drawImage(ImgD, x, y) {var ratio = ImgD.width / ImgD.height;ImgD.width = ((ratio >= x/y) ? x : ratio * y);ImgD.height = ((ratio >= x/y) ? x/ratio : y);}