shikeying
2024-01-11 104000b2ce3bdfd3fdf0f75f0713d2d3194de835
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.walker.support.kaptcha;
 
import com.walker.web.CaptchaResult;
import org.junit.Test;
 
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
 
public class WordCaptchaMain {
 
//    @Test
    public void testWordCaptcha() throws Exception{
        WordCaptchaProvider wordCaptchaProvider = new WordCaptchaProvider();
        CaptchaResult result = wordCaptchaProvider.generateCaptcha(null);
 
        System.out.println("code = " + result.getCode());
 
        BufferedImage image = result.getImage();
        FileOutputStream fileOutputStream = new FileOutputStream(new File("d:/tmp/test.png"));
        ImageIO.write(image, "png", fileOutputStream);
    }
}