com.octo.captcha.component.image.textpaster
Class RandomTextPaster
java.lang.Object
com.octo.captcha.component.image.textpaster.AbstractTextPaster
com.octo.captcha.component.image.textpaster.RandomTextPaster
- All Implemented Interfaces:
- TextPaster
- Direct Known Subclasses:
- BaffleRandomTextPaster, DoubleRandomTextPaster, LineRandomTextPaster
public class RandomTextPaster
- extends AbstractTextPaster
Paste the text randomly on the background
Constructor Summary |
RandomTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
java.awt.Color textColor)
|
RandomTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
java.awt.Color[] textColors)
|
RandomTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
ColorGenerator colorGenerator)
|
RandomTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
ColorGenerator colorGenerator,
java.lang.Boolean manageColorPerGlyph)
|
Method Summary |
java.awt.image.BufferedImage |
pasteText(java.awt.image.BufferedImage background,
java.text.AttributedString attributedString)
Paste the text randomly on the background. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
kerning
protected final int kerning
- See Also:
- Constant Field Values
textColors
protected java.awt.Color[] textColors
RandomTextPaster
public RandomTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
java.awt.Color textColor)
RandomTextPaster
public RandomTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
java.awt.Color[] textColors)
RandomTextPaster
public RandomTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
ColorGenerator colorGenerator)
RandomTextPaster
public RandomTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
ColorGenerator colorGenerator,
java.lang.Boolean manageColorPerGlyph)
pasteText
public java.awt.image.BufferedImage pasteText(java.awt.image.BufferedImage background,
java.text.AttributedString attributedString)
- Paste the text randomly on the background.
Pastes the attributed string on the backround image and return the final image. Implementation must take into
account the fact that the text must be readable by human and non by programs.
- Returns:
- the final image
- Throws:
CaptchaException
- if any exception accurs during paste routine.
Copyright 2003-2009 JCaptcha. All Rights Reserved.