二维码生成

package com.hanthink.newcertificateqrcode;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;

import javax.imageio.ImageIO;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Test test = new Test();
		BufferedImage img = NewCertificateMessgeQRCode.getQRCode("http://fw.jisheyun.com/?openId=oN0rnvrVxA2aJZZYmct-ZD9m_hQc&loginType=d", 20, 'H', 100);
		
		try {
			OutputStream out = new FileOutputStream(new File("d:/2.jpg"));
			ImageIO.write(img, "jpg", out); //将图片写入指定文件
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}

  

https://blog.csdn.net/xufenglai123/article/details/81316451

 

上一篇:Java图片读取ImageIO.read()报错:Unsupported Image Type 解决方案


下一篇:多张静态图变成动图imageio