Commit bfa397f6 authored by yaya's avatar yaya

feat:优化合成图

parent 0a9bbef0
......@@ -15,7 +15,7 @@
<!-- <div>第二步:对去完水印的图片进行抠图</div>-->
<div v-if="!imageBase64 || isCancel" class="select">
<el-button style="width: 95px" @click="handleRemoveLama">去水印</el-button>
<el-button style="width: 150px;margin-top: 20px" @click="handleCut">裁剪</el-button>
<el-button style="width: 98px;margin-top: 20px;margin-left: 0" @click="handleCut">裁剪</el-button>
</div>
<div v-if="imageBase64 && !isCancel" class="cut">
......
......@@ -438,7 +438,7 @@ export default {
}
const canvas = document.createElement('canvas')
const ctx = canvas.getContext('2d')
const imageWidth = 800
const imageWidth = 820
const imageHeight = 400
canvas.width = imageWidth
canvas.height = imageHeight
......@@ -455,7 +455,7 @@ export default {
// this.width 和 this.height 获取到的是当前图片的宽和高
// document.getElementById('canvas').width = 150
// document.getElementById('canvas').height = 150
ctx.drawImage(bgImg, imageHeight, 0, imageHeight, imageHeight)
ctx.drawImage(bgImg, imageHeight + 20, 0, imageHeight, imageHeight)
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment