JS根据图片的url获取图片的像素(宽高)
const url = 'https://threemodel.oss-cn-beijing.aliyuncs.com/barcolor2.png'
const image = new Image()
image.src = url
image.onload = () => {
console.log(image.width, image.height)
}
const url = 'https://threemodel.oss-cn-beijing.aliyuncs.com/barcolor2.png'
const image = new Image()
image.src = url
image.onload = () => {
console.log(image.width, image.height)
}
本文标题:JS根据图片的url获取图片的像素(宽高)
本文链接:https://www.haomeiwen.com/subject/dooclltx.html
网友评论