如何在这里修改图片大小?:
var image = new Image();
image.src = 'http://www.ziiweb.com/images/logo.png';
image.width = 200; //this is not modifying the width of the image
$('canvas').css({
background: 'url(' + image.src + ')'
});
<script src="https://ajax.googleapis.
为了上传图片,我读过几篇关于调整图片大小的文章/堆栈溢出的问题。但我没有找到像这样的函数:
function resize(src,maxWidth, max Height){
// some staff, creating a new Canvas and drawing the src inside
return canvas;
}
到目前为止,我只看到了如下代码:
var img = new Image();
img.src=src
img.onload(function(){
// Creating a Canvas here and do all the ne