优化验证码效果

This commit is contained in:
synchronized
2018-07-30 13:10:51 +08:00
parent 74a1991352
commit 92af7138a9
9 changed files with 160 additions and 31 deletions

View File

@@ -17,16 +17,16 @@ public class CaptchaTest {
SpecCaptcha specCaptcha = new SpecCaptcha();
//specCaptcha.setCharType(Captcha.TYPE_ONLY_NUMBER);
System.out.println(specCaptcha.text());
// specCaptcha.out(new FileOutputStream(new File("C:/Java/aa" + i + ".png")));
specCaptcha.out(new FileOutputStream(new File("D:/Java/aa" + i + ".png")));
}
}
@Test
public void testGIf() throws Exception {
for (int i = 0; i < 5; i++) {
GifCaptcha gifCaptcha = new GifCaptcha(130, 48, 5);
GifCaptcha gifCaptcha = new GifCaptcha();
System.out.println(gifCaptcha.text());
// gifCaptcha.out(new FileOutputStream(new File("C:/Java/aa" + i + ".gif")));
gifCaptcha.out(new FileOutputStream(new File("D:/Java/aa" + i + ".gif")));
}
}
@@ -35,7 +35,7 @@ public class CaptchaTest {
ChineseCaptcha chineseCaptcha = new ChineseCaptcha();
//chineseCaptcha.setFont(new Font("微软雅黑", Font.PLAIN, 25));
System.out.println(chineseCaptcha.text());
//chineseCaptcha.out(new FileOutputStream(new File("C:/Java/aa.png")));
chineseCaptcha.out(new FileOutputStream(new File("D:/Java/aa.png")));
}
@Test
@@ -43,7 +43,7 @@ public class CaptchaTest {
ChineseGifCaptcha chineseGifCaptcha = new ChineseGifCaptcha();
//chineseGifCaptcha.setFont(new Font("微软雅黑", Font.PLAIN, 30));
System.out.println(chineseGifCaptcha.text());
//chineseGifCaptcha.out(new FileOutputStream(new File("C:/Java/aa.gif")));
chineseGifCaptcha.out(new FileOutputStream(new File("D:/Java/aa.gif")));
}
}