File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 2525 $ textWatermarkRule ->setDx (10 ); // 水平(横轴)边距,单位为像素,缺省值为0
2626 $ textWatermarkRule ->setDy (10 ); // 垂直(纵轴)边距,单位为像素,默认值为0
2727 $ textWatermarkRule ->setBatch (1 ); // 平铺水印功能,可将文字水印平铺至整张图片。值为1时,表示开启平铺水印功能
28+ $ textWatermarkRule ->setSpacing (10 ); // 平铺模式下的水平、垂直间距相对文字水印贴图的宽高百分比,范围为[0,100],默认10
2829 $ textWatermarkRule ->setDegree (10 ); // 当 batch 值为1时生效。文字水印的旋转角度设置,取值范围为0 - 360,默认0
2930 $ textWatermarkRule ->setShadow (10 ); // 文字阴影效果,有效值为[0,100],默认为0,表示无阴影
3031 $ textWatermarkRule ->setScatype (1 ); // 根据原图的大小,缩放调整文字水印的大小
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ class TextWatermarkTemplate extends ImageTemplate
1616 private $ dx ;
1717 private $ dy ;
1818 private $ batch ;
19+ private $ spacing ;
1920 private $ degree ;
2021 private $ shadow ;
2122 private $ scatype ;
@@ -32,6 +33,7 @@ public function __construct() {
3233 $ this ->dx = "" ;
3334 $ this ->dy = "" ;
3435 $ this ->batch = "" ;
36+ $ this ->spacing = "" ;
3537 $ this ->degree = "" ;
3638 $ this ->shadow = "" ;
3739 $ this ->scatype = "" ;
@@ -74,6 +76,10 @@ public function setBatch($value) {
7476 $ this ->batch = "/batch/ " . $ value ;
7577 }
7678
79+ public function setSpacing ($ value ) {
80+ $ this ->spacing = "/spacing/ " . $ value ;
81+ }
82+
7783 public function setDegree ($ value ) {
7884 $ this ->degree = "/degree/ " . $ value ;
7985 }
@@ -126,6 +132,10 @@ public function getBatch() {
126132 return $ this ->batch ;
127133 }
128134
135+ public function getSpacing () {
136+ return $ this ->spacing ;
137+ }
138+
129139 public function getDegree () {
130140 return $ this ->degree ;
131141 }
@@ -172,6 +182,9 @@ public function queryString() {
172182 if ($ this ->batch ) {
173183 $ res .= $ this ->batch ;
174184 }
185+ if ($ this ->spacing ) {
186+ $ res .= $ this ->spacing ;
187+ }
175188 if ($ this ->degree ) {
176189 $ res .= $ this ->degree ;
177190 }
@@ -200,6 +213,7 @@ public function resetRule() {
200213 $ this ->dx = "" ;
201214 $ this ->dy = "" ;
202215 $ this ->batch = "" ;
216+ $ this ->spacing = "" ;
203217 $ this ->degree = "" ;
204218 $ this ->shadow = "" ;
205219 $ this ->scatype = "" ;
You can’t perform that action at this time.
0 commit comments