收藏
回答

相机camera打开闪光灯时间不对,导致拍照没补到光?

camera

<camera

  class="camera"

  frame-size="large"  flash="on"

></camera>

  <!-- frame-size="large"拍照图片高清 -->

<button class='recordbindtap='record'>拍摄</button>

js

// 拍摄按钮按下, 执行record 触发拍摄

   record(){

    console.log("开始拍照");

    this.data.cameraContext = wx.createCameraContext()

    console.log(this.data.cameraContext);

    this.data.cameraContext.takePhoto({

      quality:"high", //高质量的图片

      success: res => {

        //res.tempImagePath照片文件在手机内的的临时路径

        let tempImagePath = res.tempImagePath

        wx.saveFile({

          tempFilePath: tempImagePath,

          success: function (res) {

            //返回保存时的临时路径 res.savedFilePath

            const savedFilePath = res.savedFilePath

            // 保存到本地相册

            wx.saveImageToPhotosAlbum({

              filePath: savedFilePath,

            })

          },

          //保存失败回调(比如内存不足)

          fail: console.log

        })

      }

    })

  }



设置了 flash 为on 点击拍照时候 闪光灯确实闪了两下。 但是照片还是黑的没有补到光 。 这个问题怎么解决啊? 或者有拍照时候闪光灯设置常亮 的方法吗?(不设置 flash 为on 闪光灯确实都不闪的)

回答关注问题邀请回答
收藏

1 个回答

  • 维她命系
    维她命系
    2021-04-08

    flash: torch(常亮)

    2021-04-08
    有用
    回复 1
    • 且听风吟
      且听风吟
      2021-04-09
      万分感谢 之前没仔细看文档  下边参数  。  一值眼光就留在文档上头的  flash string auto 否 闪光灯,值为auto, on, off 1.0.0  的这句介绍上。。。。。   好尴尬
      2021-04-09
      1
      回复
登录 后发表内容
问题标签