3***@qq.com
3***@qq.com
  • 发布:2023-12-21 11:49
  • 更新:2023-12-21 11:54
  • 阅读:165

已解决已解决

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 3.98

手机系统: Android

手机系统版本号: Android 13

手机厂商: 小米

手机机型: 12sUltra

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

预期结果:

实际结果:

bug描述:

已解决

2023-12-21 11:49 负责人:无 分享
已邀请:
3***@qq.com

3***@qq.com (作者) - 晨旭猿

<view v-show="showCanvas" class="main_canvasBox">  
      <!-- <image src="{{conf.resources}}/assets/image/my_bg.png"></image> -->  
      <!-- <image src="{{avatar}}"></image> -->  
      <canvas  
        style="box-sizing: border-box; background: white"  
        canvas-id="hoCanvas"  
        id="hoCanvas"  
        :style="{ height: canvasHeight + 'px', width: canvasWidth + 'px' }"  
      ></canvas>  
      <view class="main_canvasBox_btn">  
        <text @tap.stop.prevent="cancel">取消</text>  
        <text @tap.stop.prevent="download">保存</text>  
      </view>  
    </view>  
    <view v-show="showCanvas" class="main_zIndex"></view>
3***@qq.com

3***@qq.com (作者) - 晨旭猿

let canvas = this.canvas;  
        /* 图片获取成功才执行后续代码 */  
        this.canvasHeight = 548 * rpx;  
        this.canvasWidth = 348 * rpx;  
        canvas.drawImage("/static/bj.jpg", 0, 0, 348 * rpx, 548 * rpx);  
        console.log(348 * rpx, 548 * rpx);  
        canvas.draw(true, () => {  
          that.setData({  
            showCanvas: true,  
          });  
        });

要回复问题请先登录注册