java.lang.Object
org.miaixz.bus.extra.captcha.AbstractProvider
org.miaixz.bus.extra.captcha.provider.CircleProvider
- All Implemented Interfaces:
Serializable,org.miaixz.bus.core.Provider,CaptchaProvider
Circle interference CAPTCHA provider.
- 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
ConstructorsConstructorDescriptionCircleProvider(int width, int height) Constructor.CircleProvider(int width, int height, int codeCount) Constructor.CircleProvider(int width, int height, int codeCount, int interfereCount) Constructor.CircleProvider(int width, int height, int codeCount, int interfereCount, float sizeBaseHeight) Constructor.CircleProvider(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
-
CircleProvider
public CircleProvider(int width, int height) Constructor.- Parameters:
width- Image width.height- Image height.
-
CircleProvider
public CircleProvider(int width, int height, int codeCount) Constructor.- Parameters:
width- Image width.height- Image height.codeCount- Number of characters.
-
CircleProvider
public CircleProvider(int width, int height, int codeCount, int interfereCount) Constructor.- Parameters:
width- Image width.height- Image height.codeCount- Number of characters.interfereCount- Number of interfering elements.
-
CircleProvider
Constructor.- Parameters:
width- Image width.height- Image height.generator- CAPTCHA code generator.interfereCount- Number of interfering elements.
-
CircleProvider
public CircleProvider(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.
-