Pārlūkot izejas kodu

海报字体调整

shizhongqi 10 mēneši atpakaļ
vecāks
revīzija
75c6b6ae28
1 mainītis faili ar 6 papildinājumiem un 7 dzēšanām
  1. 6 7
      app-hd/controllers/RechargeController.php

+ 6 - 7
app-hd/controllers/RechargeController.php

@@ -87,12 +87,11 @@ class RechargeController extends BaseController
 		$miniCodeResizeBase64 = stringUtil::ossBase64($miniCodeResizeUrl);
 		$posterProcess .= '/watermark,image_' . $miniCodeResizeBase64 . ',g_se,x_' . $qrRightPadding . ',y_' . $qrBottomPadding;
         $positions = [
-            ['recharge' => ['x' => 240, 'y' => 665], 'give' => ['x' => 520, 'y' => 665]],
-            ['recharge' => ['x' => 220, 'y' => 845], 'give' => ['x' => 500, 'y' => 845]],
-            ['recharge' => ['x' => 220, 'y' => 1030], 'give' => ['x' => 500, 'y' => 1030]],
+            ['recharge' => ['x' => 220, 'y' => 660], 'give' => ['x' => 500, 'y' => 660]],
+            ['recharge' => ['x' => 220, 'y' => 840], 'give' => ['x' => 500, 'y' => 840]],
+            ['recharge' => ['x' => 220, 'y' => 1020], 'give' => ['x' => 500, 'y' => 1020]],
         ];
-        $fontSize = 44; // 数值字号
-        $fontColor = '333333';
+        $fontSize = 50; // 数值字号
 		if (!empty($recharge)) {
 			// 先生成同一张图片上的文字水印串,最后再与$posterProcess合并
 			$textProcess = '';
@@ -106,11 +105,11 @@ class RechargeController extends BaseController
                 $giveText = (string)(intval($val['give']) ?? '');
                 if ($rechargeText !== '') {
                     $rechargeBase64 = stringUtil::ossBase64($rechargeText);
-					$textProcess .= '/watermark,text_' . $rechargeBase64 . ',g_nw,x_' . $pos['recharge']['x'] . ',y_' . $pos['recharge']['y'] . ',size_' . $fontSize . ',color_' . $fontColor;
+					$textProcess .= '/watermark,text_' . $rechargeBase64 . ',g_nw,x_' . $pos['recharge']['x'] . ',y_' . $pos['recharge']['y'] . ',size_' . $fontSize . ',color_333333,type_' . stringUtil::ossBase64('fangzhengheiti');
                 }
                 if ($giveText !== '') {
                     $giveBase64 = stringUtil::ossBase64($giveText);
-					$textProcess .= '/watermark,text_' . $giveBase64 . ',g_nw,x_' . $pos['give']['x'] . ',y_' . $pos['give']['y'] . ',size_' . $fontSize . ',color_' . $fontColor;
+					$textProcess .= '/watermark,text_' . $giveBase64 . ',g_nw,x_' . $pos['give']['x'] . ',y_' . $pos['give']['y'] . ',size_' . $fontSize . ',color_FFD100,type_' . stringUtil::ossBase64('fangzhengheiti');
                 }
             }
 			$posterProcess .= $textProcess;