布局(宽 100% ,比例宽:高 = 3:4)
<camera mode="normal" resolution="high"
device-position="{{cameraState.devicePosition}}" id="camera"
flash="{{cameraState.flash}}" bindstop="cameraBindStop" binderror="cameraBindError"
class="camera">
</camera>
拍摄
wx.createCameraContext()
.takePhoto({
quality: 'high',
success: async (res) => {
fail: (res) => {
},
complete: () => {
}
})
手机是 iphone 13 pro max,使用这段代码拍摄,产出图片只有 1080 * 1438,原相机 3024 * 4032