All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.atomtool.captcha.service.ConfigurableCaptchaService Maven / Gradle / Ivy

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;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy