예제 #1
0
 @Test
 public void generateCaptcha() throws Exception {
   ImageUtils imageUtils = new ImageUtils();
   imageUtils.setPath("captcha");
   imageUtils.setBase("captcha");
   imageUtils.setType("png");
   imageUtils.setDefaultBackground(new Color(1f, 1f, 1f, 0f));
   FileOutputStream os = new FileOutputStream("E:/test/sisda/captcha.png");
   imageUtils.createCaptchaImage("Halo", os);
   os.close();
 }
예제 #2
0
  @Test
  public void generateText() throws IOException {
    ImageUtils imageUtils = new ImageUtils();
    imageUtils.setPath("captcha");
    imageUtils.setBase("captcha");
    imageUtils.setType("png");
    imageUtils.setDefaultBackground(new Color(1f, 1f, 1f, 0f));
    FileOutputStream os = new FileOutputStream("E:/test/sisda/email.png");
    imageUtils.createTextImage("*****@*****.**", os);

    os.close();
  }