Skip to content

Commit 2e8ae5c

Browse files
committed
alpha channel property
1 parent f22e4b1 commit 2e8ae5c

File tree

2 files changed

+6915
-4
lines changed

2 files changed

+6915
-4
lines changed

upload-2.vue

+11-4
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,12 @@ export default {
188188
withCredentials: {
189189
type: Boolean,
190190
'default': false
191-
}
191+
},
192+
193+
withAlphaChannel: {
194+
type: Boolean,
195+
'default': false
196+
}
192197
},
193198
data() {
194199
let that = this,
@@ -783,9 +788,11 @@ export default {
783788
canvas.height = that.height;
784789
ctx.clearRect(0, 0, that.width, that.height);
785790
786-
// 将透明区域设置为白色底边
787-
// ctx.fillStyle = "#fff";
788-
// ctx.fillRect(0, 0, that.width, that.height);
791+
if(!that.withAlphaChannel){
792+
// 将透明区域设置为白色底边
793+
ctx.fillStyle = "#fff";
794+
ctx.fillRect(0, 0, that.width, that.height);
795+
}
789796
790797
ctx.translate(that.width * 0.5, that.height * 0.5);
791798
ctx.rotate(Math.PI * degree / 180);

0 commit comments

Comments
 (0)