Browse Source

修改图片

lex 9 months ago
parent
commit
a0e0a48d59

+ 5 - 5
src/tenant/music/music-detail/imageFunction.ts

@@ -80,15 +80,15 @@ export const addMusicTitle = (canvas, info) => {
 
   // 小水印画布大小
   water.width = canvas.width
-  water.height = canvas.height + 30
+  water.height = canvas.height + 40
   const waterCtx = water.getContext('2d') as CanvasRenderingContext2D
   waterCtx.fillStyle = '#fff'
-  waterCtx.fillRect(0, 0, canvas.width, canvas.height + 70)
-  waterCtx.font = `40pt Calibri`
+  waterCtx.fillRect(0, 0, canvas.width, canvas.height + 40)
+  waterCtx.font = `26pt Calibri`
   waterCtx.fillStyle = '#000'
   waterCtx.textAlign = 'center'
-  waterCtx.drawImage(canvas, 0, 70)
-  waterCtx.fillText(info.title, canvas.width / 2, 120)
+  waterCtx.drawImage(canvas, 0, 40)
+  waterCtx.fillText(info.title, canvas.width / 2, 80)
   return water
 }
 

+ 5 - 5
src/views/music/music-detail/imageFunction.ts

@@ -81,15 +81,15 @@ export const addMusicTitle = (canvas, info) => {
 
   // 小水印画布大小
   water.width = canvas.width
-  water.height = canvas.height + 30
+  water.height = canvas.height + 40
   const waterCtx = water.getContext('2d') as CanvasRenderingContext2D
   waterCtx.fillStyle = '#fff'
-  waterCtx.fillRect(0, 0, canvas.width, canvas.height + 70)
-  waterCtx.font = `40pt Calibri`
+  waterCtx.fillRect(0, 0, canvas.width, canvas.height + 40)
+  waterCtx.font = `26pt Calibri`
   waterCtx.fillStyle = '#000'
   waterCtx.textAlign = 'center'
-  waterCtx.drawImage(canvas, 0, 70)
-  waterCtx.fillText(info.title, canvas.width / 2, 120)
+  waterCtx.drawImage(canvas, 0, 40)
+  waterCtx.fillText(info.title, canvas.width / 2, 80)
   return water
 }