feature: add captcha font size

This commit is contained in:
FRANKSTEIN11
2024-04-04 23:52:30 +08:00
parent bf7738e6f9
commit 397bcd7341
7 changed files with 201 additions and 27 deletions

View File

@@ -32,6 +32,15 @@ public class CaptchaTest {
lineCaptcha.write("f:/test/captcha/tellow.png");
}
@Test
@Ignore
public void lineCaptchaTestWithSize() {
// 定义图形验证码的长和宽
LineCaptcha lineCaptcha = CaptchaUtil.createLineCaptcha(200, 70, 4, 15, 0.65f);
lineCaptcha.setBackground(Color.yellow);
lineCaptcha.write("f:/test/captcha/tellow.png");
}
@Test
@Ignore
public void lineCaptchaWithMathTest() {
@@ -75,12 +84,22 @@ public class CaptchaTest {
captcha.verify("1234");
}
@Test
@Ignore
public void circleCaptchaTestWithSize() {
// 定义图形验证码的长和宽
CircleCaptcha captcha = CaptchaUtil.createCircleCaptcha(200, 70, 4, 15, 0.65f);
captcha.setBackground(Color.yellow);
captcha.write("f:/test/captcha/circle.png");
}
@Test
@Ignore
public void shearCaptchaTest() {
// 定义图形验证码的长和宽
ShearCaptcha captcha = CaptchaUtil.createShearCaptcha(203, 100, 4, 4);
ShearCaptcha captcha = CaptchaUtil.createShearCaptcha(200, 100, 4, 4);
// ShearCaptcha captcha = new ShearCaptcha(200, 100, 4, 4);
// 图形验证码写出,可以写出到文件,也可以写出到流
captcha.write("f:/captcha/shear.png");
@@ -113,6 +132,16 @@ public class CaptchaTest {
captcha.verify("1234");
}
@Test
@Ignore
public void ShearCaptchaTestWithSize() {
// 定义图形验证码的长和宽
ShearCaptcha captcha = CaptchaUtil.createShearCaptcha(200, 70, 4, 15, 0.65f);
captcha.setBackground(Color.yellow);
captcha.write("f:/test/captcha/shear.png");
}
@Test
@Ignore
public void GifCaptchaTest() {
@@ -123,7 +152,16 @@ public class CaptchaTest {
@Test
@Ignore
public void bgTest(){
public void GifCaptchaTestWithSize() {
// 定义图形验证码的长和宽
GifCaptcha captcha = CaptchaUtil.createGifCaptcha(200, 70, 4, 15, 0.65f);
captcha.setBackground(Color.yellow);
captcha.write("f:/test/captcha/gif.png");
}
@Test
@Ignore
public void bgTest() {
LineCaptcha captcha = CaptchaUtil.createLineCaptcha(200, 100, 4, 1);
captcha.setBackground(Color.WHITE);
captcha.write("d:/test/test.jpg");