cn.atomtool.captcha.service.ConfigurableCaptchaService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of atomtool-captcha Show documentation
Show all versions of atomtool-captcha Show documentation
atomTool核心工具包,包括集合、字符串、Bean等工具类
The newest version!
package cn.atomtool.captcha.service;
import cn.atomtool.captcha.background.SingleColorBackgroundFactory;
import cn.atomtool.captcha.color.SingleColorFactory;
import cn.atomtool.captcha.filter.predefined.CurvesRippleFilterFactory;
import cn.atomtool.captcha.font.RandomFontFactory;
import cn.atomtool.captcha.text.renderer.BestFitTextRenderer;
import cn.atomtool.captcha.word.AdaptiveRandomWordFactory;
public class ConfigurableCaptchaService extends AbstractCaptchaService {
public ConfigurableCaptchaService() {
backgroundFactory = new SingleColorBackgroundFactory();
wordFactory = new AdaptiveRandomWordFactory();
fontFactory = new RandomFontFactory();
textRenderer = new BestFitTextRenderer();
colorFactory = new SingleColorFactory();
filterFactory = new CurvesRippleFilterFactory(colorFactory);
textRenderer.setLeftMargin(10);
textRenderer.setRightMargin(10);
width = 160;
height = 70;
}
}