public class ImageUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
VERIFY_CODES
The constant VERIFY_CODES.
|
| 构造器和说明 |
|---|
ImageUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
genCode(int verifySize)
使用系统默认字符源生成验证码
|
static String |
genCode(int verifySize,
String sources)
使用指定源生成验证码
|
static void |
main(String[] args)
The entry point of application.
|
static void |
outputImage(int w,
int h,
File outputFile,
String code)
生成指定验证码图像文件
|
static void |
outputImage(int w,
int h,
OutputStream os,
String code)
输出指定验证码图片流
|
static String |
outputVerifyImage(int w,
int h,
File outputFile,
int verifySize)
生成随机验证码文件,并返回验证码值
|
static String |
outputVerifyImage(int w,
int h,
OutputStream os,
int verifySize)
输出随机验证码图片流,并返回验证码值
|
public static String genCode(int verifySize)
verifySize - 验证码长度public static String genCode(int verifySize, String sources)
verifySize - 验证码长度sources - 验证码字符源public static String outputVerifyImage(int w, int h, File outputFile, int verifySize) throws IOException
w - the wh - the houtputFile - the output fileverifySize - the verify sizeIOException - the io exceptionpublic static String outputVerifyImage(int w, int h, OutputStream os, int verifySize) throws IOException
w - the wh - the hos - the osverifySize - the verify sizeIOException - the io exceptionpublic static void outputImage(int w,
int h,
File outputFile,
String code)
throws IOException
w - the wh - the houtputFile - the output filecode - the codeIOException - the io exceptionpublic static void outputImage(int w,
int h,
OutputStream os,
String code)
throws IOException
w - the wh - the hos - the oscode - the codeIOException - the io exceptionpublic static void main(String[] args) throws IOException
args - the input argumentsIOException - the io exceptionCopyright © 2018. All rights reserved.