mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
feature: add captcha font size
This commit is contained in:
@@ -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");
|
||||
|
Reference in New Issue
Block a user