增加内置字体,增加贝赛尔曲线干扰线

This commit is contained in:
whvcse@foxmail.com
2019-08-22 17:14:16 +08:00
parent b390fe3f3f
commit 366f54ea80
22 changed files with 194 additions and 44 deletions

View File

@@ -1,5 +1,8 @@
package com.wf.captcha;
import com.wf.captcha.base.Captcha;
import com.wf.captcha.utils.GifEncoder;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
@@ -84,6 +87,7 @@ public class GifCaptcha extends Captcha {
// 随机画干扰线
drawLine(2, g2d);
// 画验证码
Font font = getFont();
int hp = (height - font.getSize()) >> 1;
int h = height - hp;
int w = width / strs.length;