patchca 是一个简单但功能强大的验证码的Java类库。
效果:
示例代码:
ConfigurableCaptchaService cs = new ConfigurableCaptchaService(); cs.setColorFactory(new SingleColorFactory(new Color(25, 60, 170))); cs.setFilterFactory(new CurvesRippleFilterFactory(cs.getColorFactory())); FileOutputStream fos = new FileOutputStream("patcha_demo.png"); EncoderHelper.getChallangeAndWriteImage(cs, "png", fos); fos.close();