Reputation: 15378
as here to change the size? I can not find the right method
var img = new Image();
img.src = newImg.ImagePath;
Upvotes: 0
Views: 468
Reputation: 23537
A 100px x 100px
image.
var img = new Image();
img.src = newImg.ImagePath;
img.width = 100;
img.height = 100;
Upvotes: 1
Reputation: 318698
$(img).width(width_in_pixels).height(height_in_pixels);
Instead of $(img)
you can also use a $('selector')
. If you want to create a new one, use this:
$('<img/>', {src: 'url to the image'}).width(width_in_pixels).height(height_in_pixels).appendTo('#someElement');
Upvotes: 2