小程序camera拍照
!--wxml--camera device-position="front" flash="auto" binderror="error" class="camera" cover-view cover-view class="viewTakePhoto" cover-image class="btnImg" src="../../images/btnTakePhoto.png" bindtap="clickTakePhoto"/ /cover-view /cover-view/camera/**wxss.wxss**/wxss.viewTakePhoto{ flex: 1; height: 100%; text-align: center; line-height: 50px;}.btnImg { width: 100rpx; height: 100rpx; margin-top: 430px; margin-left:310rpx;}.camera{ width: 100%; height:550px;} //js clickTakePhoto: function () { const ctx = wx.createCameraContext() ctx.takePhoto({ quality: 'high', success: (res) = { console.log(res.tempImagePath) } }) }, error(e) { console.log(e.detail) }注:微信开发者工具版本低,照片会有蓝色滤镜,微信开发者工具要更新到最新版本
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

