public class GifCaptcha extends AbstractCaptcha
background, code, font, generator, height, imageBytes, interfereCount, textAlpha, width
Constructor and Description |
---|
GifCaptcha(int width,
int height)
可以设置验证码宽度,高度的构造函数
|
GifCaptcha(int width,
int height,
CodeGenerator generator,
int interfereCount)
构造
|
GifCaptcha(int width,
int height,
int codeCount) |
GifCaptcha(int width,
int height,
int codeCount,
int interfereCount) |
GifCaptcha(int width,
int height,
int codeCount,
int interfereCount,
float size)
构造
|
Modifier and Type | Method and Description |
---|---|
void |
createCode()
创建验证码,实现类需同时生成随机验证码字符串和验证码图片
|
protected Image |
createImage(String code)
根据生成的code创建验证码图片
|
GifCaptcha |
setMaxColor(int maxColor)
设置验证码字符颜色
|
GifCaptcha |
setMinColor(int minColor)
设置验证码字符颜色
|
GifCaptcha |
setQuality(int quality)
设置图像的颜色量化(转换质量 由GIF规范允许的最大256种颜色)。
|
GifCaptcha |
setRepeat(int repeat)
设置GIF帧应该播放的次数。
|
generateCode, getCode, getGenerator, getImage, getImageBase64, getImageBase64Data, getImageBytes, setBackground, setFont, setGenerator, setTextAlpha, verify, write, write, write
public GifCaptcha(int width, int height)
width
- 验证码宽度height
- 验证码高度public GifCaptcha(int width, int height, int codeCount)
width
- 验证码宽度height
- 验证码高度codeCount
- 验证码个数public GifCaptcha(int width, int height, int codeCount, int interfereCount)
width
- 验证码宽度height
- 验证码高度codeCount
- 验证码个数interfereCount
- 验证码干扰元素个数public GifCaptcha(int width, int height, CodeGenerator generator, int interfereCount)
width
- 图片宽height
- 图片高generator
- 验证码生成器interfereCount
- 验证码干扰元素个数public GifCaptcha(int width, int height, int codeCount, int interfereCount, float size)
width
- 图片宽height
- 图片高codeCount
- 验证码个数interfereCount
- 验证码干扰元素个数size
- 字体的大小 高度的倍数public GifCaptcha setQuality(int quality)
quality
- 大于1public GifCaptcha setRepeat(int repeat)
repeat
- 必须大于等于0public GifCaptcha setMaxColor(int maxColor)
maxColor
- 颜色public GifCaptcha setMinColor(int minColor)
minColor
- 颜色public void createCode()
ICaptcha
createCode
in interface ICaptcha
createCode
in class AbstractCaptcha
protected Image createImage(String code)
AbstractCaptcha
createImage
in class AbstractCaptcha
code
- 验证码Copyright © 2024. All rights reserved.