Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
one-certificate-system
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
one-certificate-system
Commits
e6ed173a
Commit
e6ed173a
authored
Aug 23, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加水印图片
parent
f08c9624
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
one-certificate-manager/src/main/java/com/mortals/xhx/common/utils/WatermarkImgUtils.java
.../java/com/mortals/xhx/common/utils/WatermarkImgUtils.java
+3
-3
No files found.
one-certificate-manager/src/main/java/com/mortals/xhx/common/utils/WatermarkImgUtils.java
View file @
e6ed173a
...
@@ -25,7 +25,7 @@ public class WatermarkImgUtils {
...
@@ -25,7 +25,7 @@ public class WatermarkImgUtils {
Font
font
=
new
Font
(
"宋体"
,
Font
.
BOLD
,
100
);
//水印字体,大小
Font
font
=
new
Font
(
"宋体"
,
Font
.
BOLD
,
100
);
//水印字体,大小
Color
markContentColor
=
Color
.
red
;
//水印颜色
Color
markContentColor
=
Color
.
red
;
//水印颜色
Integer
degree
=
45
;
//设置水印文字的旋转角度
Integer
degree
=
45
;
//设置水印文字的旋转角度
float
alpha
=
0.
5
f
;
//设置水印透明度
float
alpha
=
0.
3
f
;
//设置水印透明度
OutputStream
outImgStream
=
null
;
OutputStream
outImgStream
=
null
;
try
{
try
{
File
srcImgFile
=
new
File
(
sourceImgPath
);
//得到文件
File
srcImgFile
=
new
File
(
sourceImgPath
);
//得到文件
...
@@ -55,7 +55,7 @@ public class WatermarkImgUtils {
...
@@ -55,7 +55,7 @@ public class WatermarkImgUtils {
columnsNumber
=
1
;
columnsNumber
=
1
;
}
}
g
.
drawString
(
waterMarkContent
,
width
+
width
/
2
,
width
-
width
/
2
);
g
.
drawString
(
waterMarkContent
,
width
-
150
,
-
280
);
/* for(int j=0;j<rowsNumber;j++){
/* for(int j=0;j<rowsNumber;j++){
boolean bool=false;
boolean bool=false;
...
@@ -88,7 +88,7 @@ public class WatermarkImgUtils {
...
@@ -88,7 +88,7 @@ public class WatermarkImgUtils {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
WatermarkImgUtils
.
addWatermark
(
"E:\\pic\\
back.jpg"
,
"E:\\pic\\back_water1.jpg"
,
"你好,世界!
"
,
"jpg"
);
WatermarkImgUtils
.
addWatermark
(
"E:\\pic\\
1724379763618.jpg"
,
"E:\\pic\\1724379763618_water1.jpg"
,
"广安市一业一证(照)一码
"
,
"jpg"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment