java.lang.Object
org.miaixz.bus.extra.captcha.AbstractProvider
org.miaixz.bus.extra.captcha.provider.LineProvider
- All Implemented Interfaces:
Serializable,org.miaixz.bus.core.Provider,CaptchaProvider
CAPTCHA provider that uses interfering lines.
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Field Summary
Fields inherited from class org.miaixz.bus.extra.captcha.AbstractProvider
background, code, font, generator, height, imageBytes, interfereCount, textAlpha, width -
Constructor Summary
ConstructorsConstructorDescriptionLineProvider(int width, int height) Constructor with default 5-character code and 150 interfering lines.LineProvider(int width, int height, int codeCount, int lineCount) Constructor.LineProvider(int width, int height, int codeCount, int interfereCount, float sizeBaseHeight) Constructor.LineProvider(int width, int height, CodeStrategy generator, int interfereCount) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateImage(String code) Creates the CAPTCHA image based on the generated code.Methods inherited from class org.miaixz.bus.extra.captcha.AbstractProvider
create, generateCode, get, getGenerator, getImage, getImageBase64, getImageBase64Data, getImageBytes, setBackground, setFont, setGenerator, setTextAlpha, verify, write, write, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.miaixz.bus.extra.captcha.CaptchaProvider
type
-
Constructor Details
-
LineProvider
public LineProvider(int width, int height) Constructor with default 5-character code and 150 interfering lines.- Parameters:
width- Image width.height- Image height.
-
LineProvider
public LineProvider(int width, int height, int codeCount, int lineCount) Constructor.- Parameters:
width- Image width.height- Image height.codeCount- Number of characters.lineCount- Number of interfering lines.
-
LineProvider
Constructor.- Parameters:
width- Image width.height- Image height.generator- CAPTCHA code generator.interfereCount- Number of interfering elements.
-
LineProvider
public LineProvider(int width, int height, int codeCount, int interfereCount, float sizeBaseHeight) Constructor.- Parameters:
width- Image width.height- Image height.codeCount- Number of characters.interfereCount- Number of interfering elements.sizeBaseHeight- Font size as a multiplier of the height.
-
-
Method Details
-
createImage
Description copied from class:AbstractProviderCreates the CAPTCHA image based on the generated code.- Specified by:
createImagein classAbstractProvider- Parameters:
code- The CAPTCHA code.- Returns:
- The CAPTCHA image.
-