mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
73b2f75de2
commit
ac314bb14a
@ -0,0 +1,15 @@
|
||||
package cn.hutool.core.img;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.awt.Font;
|
||||
|
||||
public class FontUtilTest {
|
||||
|
||||
@Test
|
||||
public void createFontTest(){
|
||||
final Font font = FontUtil.createFont();
|
||||
Assert.assertNotNull(font);
|
||||
}
|
||||
}
|
@ -4,6 +4,9 @@ import cn.hutool.core.io.FileUtil;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
|
||||
public class ImgTest {
|
||||
|
||||
@Test
|
||||
@ -23,4 +26,17 @@ public class ImgTest {
|
||||
public void roundTest() {
|
||||
Img.from(FileUtil.file("e:/pic/face.jpg")).round(0.5).write(FileUtil.file("e:/pic/face_round.png"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void pressTextTest() {
|
||||
Img.from(FileUtil.file("d:/test/617180969474805871.jpg"))
|
||||
.setPositionBaseCentre(false)
|
||||
.pressText("版权所有", Color.RED, //
|
||||
new Font("黑体", Font.BOLD, 100), //
|
||||
0, //
|
||||
100, //
|
||||
1f)
|
||||
.write(FileUtil.file("d:/test/test2_result.png"));
|
||||
}
|
||||
}
|
||||
|
@ -70,13 +70,13 @@ public class ImgUtilTest {
|
||||
@Ignore
|
||||
public void pressTextTest() {
|
||||
ImgUtil.pressText(//
|
||||
FileUtil.file("e:/pic/face.jpg"), //
|
||||
FileUtil.file("e:/pic/test2_result.png"), //
|
||||
"版权所有", Color.WHITE, //
|
||||
FileUtil.file("d:/test/617180969474805871.jpg"), //
|
||||
FileUtil.file("d:/test/test2_result.png"), //
|
||||
"版权所有", Color.RED, //
|
||||
new Font("黑体", Font.BOLD, 100), //
|
||||
0, //
|
||||
0, //
|
||||
0.8f);
|
||||
1f);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user