收藏
回答

关于camera调用的问题

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug camera 工具 6.6.6 1.9.93

微信小程序,camera组件调用时能够,能够在拍照界面添加取景框吗?或者在相加拍照界面添加背景图片?可以实现AR效果吗?求教

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

5 个回答

  • 2018-09-17

    你好,请问你的问题解决了吗


    2018-09-17
    有用
    回复 4
    • 杰
      2018-09-17

      使用了cover-view

      2018-09-17
      回复
    • 2018-09-17回复
      怎么处理的?方便发个demo吗
      2018-09-17
      回复
    • 杰
      2018-09-17回复

      参考的楼下王凡的代码

      2018-09-17
      回复
    • 2018-09-18回复

      有js部分的吗

      2018-09-18
      回复
  • z.y.p
    z.y.p
    2018-06-02

    camera 组件里使用  cover-view 组件就可以吧。

    2018-06-02
    有用
    回复
  • 王凡
    王凡
    2018-06-01

    你要这样的?

    2018-06-01
    有用
    回复 6
    • 杰
      2018-06-01

      对的,请问怎么实现的

      2018-06-01
      回复
    • 王凡
      王凡
      2018-06-02

      camera +cover-view+cover-image 下面是布局


      <!-- 自定义相机 -->

      <view wx:if="{{showCamera}}" class='customcamera'>

      <view wx:if="{{!showPreview}}" class='cameraview'>

      <camera flash="{{flash}}" device-position="{{cmodel}}" bindstop='photostop' style='background:rgba(0,0,0,0.5)' binderror='photoerr'>

      <cover-view class="{{curimgtype!='hand'?'cameraview':'cpnl'}}">

      <cover-image  style='width:100%;height:100%'   src='{{pnlimg}}'>

      </cover-image>

      </cover-view>

      <cover-view  class='cmodel'  wx:if="{{curimgtype=='hand'}}" >

      <cover-image   catchtap='changemodel'  src='../../images/cchange.png' style='width:20px;height:20px;padding:5px'></cover-image>  

      </cover-view>

      </camera>

      </view>

      <view wx:else class='cameraview'>

      <image mode='aspectFit' src='{{prviewImg}}'></image>

      </view>

      <view class='camerabtn'>

      <view class='clickbtn'>

      <view bindtap='clickCancel' data-text='{{cancelText}}'>{{cancelText}}</view>

      <view class='btnimg'>

      <image bindtap='clickCamera' src="{{!photoactive?'../../images/photo.png':'../../images/photo_enter.png'}}"></image>

      </view>

      <view bindtap='useImg'>{{sureText}}</view>

      </view>

      </view>

      </view>



      2018-06-02
      回复
    • 杰
      2018-06-02回复王凡

      多谢,我试试

      2018-06-02
      回复
    • 咖啡加盐
      咖啡加盐
      2018-06-03回复王凡

      你好,能否把

      wxss 也贴出来

      2018-06-03
      回复
    • 王凡
      王凡
      2018-06-04回复咖啡加盐

      /* 拍照取景框 */

      .customcamera{

      height: 100vh;

      width: 100%;

      position: fixed;

      top: 0;

      background: rgb(0, 0,0);

      /* display: flex;

       flex-direction: column; */

      }

      .cameraview{

      height: 88vh;

      display: -webkit-flex;

      align-items:center;


      }

      .cameraviewborder{

      position: relative;

      height: 86vh;

      margin: auto;

      left: 0;

      right: 0;

      top:7vh;

      width: 60vh;


      }

      .camerabtn{

      height: 12vh;

      display: flex;

      flex-direction: column;

      background: rgba(0,0,0,0.5);

      font-size: 15px;

      }

      .cameraview camera{

      height: 100%;

      width: 100%;

      }

      .cameraview image{

      width: 100%;

      height: 100%;

      }

      .cmodel{

      width:100%;

      height:5%;

      background:rgba(0,0,0,0.3);

      display:-webkit-flex;

      justify-content:flex-end;

      align-items:center;

      }

      .cmodel image{

      width:20px;height:20px;padding:5px

      }


      .cpnl{

      width:100%;

      height:95%;

      }

      .showtost{

      flex: 1;

      text-align: center;

      color: white;

      font-size: 12px;

      line-height: 22px;

      }


      .clickbtn{

      flex: 3;

      display: flex;

      flex-direction: row;


      }

      .clickbtn view{

      flex: 1;


      align-items:center;

      display:-webkit-flex;

      justify-content:center;

      color: white;

      }

      .btnimg {

      text-align: center;

      }

      .btnimg image{

      width: 60px;

      height: 60px;

      }





      2018-06-04
      回复
    查看更多(1)
  • 咖啡加盐
    咖啡加盐
    2018-06-01

    你好该问题是否已经解决?

    2018-06-01
    有用
    回复 1
    • 杰
      2018-06-01

      还没有,请问你有好办法吗?


      2018-06-01
      回复
  • 睡前原谅一切
    睡前原谅一切
    2018-06-01

    貌似不可以吧

    2018-06-01
    有用
    回复
登录 后发表内容