uni.getImageInfo({
src: "https://zjz-1254115331.cos.ap-beijing.myqcloud.com/20231128/656547269e5111701136166.jpg",
success: function(image) {
let getWindowInfo = uni.getWindowInfo()
console.log("image", image);
const mmWidth = (image.width / 300) * 25.4;
const mmHeight = (image.height / 300) * 25.4;
console.log("mmWidth", Math.round(mmWidth));
console.log("mmHeight", Math.round(mmHeight));
}
});
前端uniapp中获取图片宽高 并转换为mm
最新推荐文章于 2024-07-12 16:55:56 发布