html直接加载二维码图片

<html>
    <body>
        <img width="100px" height="100px;" src="data:image/jpg;base64,二维码图片转成的字符串" />
    </body>

</html>

二维码字符串转图片:(axis.jar)

String qrCodeStr = “......”;//二维码字符串

String qrCodeUrl = "/Users/test";//二维码图片存放路径

byte[] buf=Base64.decode(qrCodeStr);

try {
    FileOutputStream fos = new FileOutputStream(qrCodeUrl);
    fos.write(buf);
    fos.close();
} catch (Exception e) {

    ......

}


猜你喜欢

转载自blog.csdn.net/BankZhao/article/details/79972265
今日推荐