The example you are pointing to is really for the Spring Framework. But it does not really matter. I can imagine the difficulties that may arise, who does not know how dependency injection works. So this is the same programmatically. Notice, I will shorten it for brevity.
- You need to create an ImageCaptchaFactory from your given URL,
com.octo.captcha.image.gimpy.GimpyFactory - Put this in ImageCaptchaEngine, creating an instance of your captcha engine, namely
com.octo.captcha.engine.GenericCaptchaEngine - And then pass this to your captcha service,
com.octo.captcha.service.multitype.GenericManageableCaptchaService
Now about colors and fonts. You will need to provide color and font information in your captcha factory. How? There he is,
- factory receives object type arguments generator words and word-image composer that are respectively
com.octo.captcha.component.wordgenerator.DictionaryWordGeneratorandcom.octo.captcha.component.image.wordtoimage.ComposedWordToImage - , . , , , , .
- , , . , ,
com.octo.captcha.component.image.fontgenerator.RandomFontGenerator factory - ,
com.octo.captcha.component.image.backgroundgenerator.UniColorBackgroundGenerator com.octo.captcha.component.image.color.SingleColorGenerator - ,
com.octo.captcha.component.image.color.RandomRangeColorGenerator