初学者求问 微信小程序中调用拍摄api
wx.chooseMedia后 如何获取拍摄图片的宽 高
wx.chooseMedia({
count: 1,
sourceType: ['camera'],
success(res) {
const filePath = res.tempFilePaths[0]
wx.getImageInfo({
src: filePath,
success(res) {
const width = res.width
const height = res.height
// Use the width and height values here...
}
})
}
})