public class DragCaptchaImageUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
IMAGE_BASE64
验证码图片的base64编码
|
| 构造器和说明 |
|---|
DragCaptchaImageUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
getImageBASE64(BufferedImage image)
将图片转换为BASE64
|
static BufferedImage |
getRandomImage(String path)
随机获取一张图片对象
|
static DragCaptchaImageDTO |
getVerifyImage(InputStream inputStream)
根据传入的路径生成指定验证码图片
|
static void |
writeImg(BufferedImage image,
String file)
将IMG输出为文件
|
public static DragCaptchaImageDTO getVerifyImage(InputStream inputStream) throws IOException
IOExceptionpublic static BufferedImage getRandomImage(String path) throws IOException
IOExceptionpublic static void writeImg(BufferedImage image, String file) throws Exception
Exceptionpublic static String getImageBASE64(BufferedImage image) throws IOException
IOExceptionCopyright © 2022. All rights reserved.