吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 4924|回复: 12
收起左侧

微信含有二维码头像上传求方法

[复制链接]
zs8005 发表于 2021-3-24 16:20
30吾爱币
   微信二维码头像怎么上传求方法

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

Ykkkr 发表于 2021-3-24 16:36

0
昨天刚做了一个,玩了一把。下面是生成二维码的代码

Java代码  收藏代码
/**
     * 生成二维码(QRCode)图片
     *  
     * @Param content
     * @param imgPath
     */  
    public static void encodeQr(String content, String imgPath) {  
        try {  
  
            Qrcode qrcodeHandler = new Qrcode();  
            qrcodeHandler.setQrcodeErrorCorrect('M');  
            qrcodeHandler.setQrcodeEncodeMode('B');  
            qrcodeHandler.setQrcodeVersion(7);  
  
            System.out.println(content);  
            byte[] contentBytes = content.getBytes("gb2312");  
  
            BufferedImage bufImg = new BufferedImage(140, 140,  
                    BufferedImage.TYPE_INT_RGB);  
  
            Graphics2D gs = bufImg.createGraphics();  
  
            gs.setBackground(Color.WHITE);  
            gs.clearRect(0, 0, 140, 140);  
  
            // 设定图像颜色> BLACK  
            gs.setColor(Color.BLUE);  
  
            // 设置偏移量   
            int pixoff = 2;  
            //将内容输出到图片中  
            if (contentBytes.length > 0 && contentBytes.length < 123) {  
                boolean[][] codeOut = qrcodeHandler.calQrcode(contentBytes);  
                for (int i = 0; i < codeOut.length; i++) {  
                    for (int j = 0; j < codeOut.length; j++) {  
                        if (codeOut[j]) {  
                            gs.fillRect(j * 3 + pixoff, i * 3 + pixoff, 3, 3);  
                        }  
                    }  
                }  
            } else {  
                System.err.println("QRCode content bytes length = "  
                        + contentBytes.length + " not in [ 0,123 ]. ");  
            }  
  
            gs.dispose();  
            bufImg.flush();  
            File imgFile = new File(imgPath);  
            // 生成二维码图片  
            ImageIO.write(bufImg, "png", imgFile);  
        } catch (Exception e) {  
            e.printStackTrace();  
        }  
    }  
  
    /**
     * @param args
     *            the command line arguments
     */  
    public static void main(String[] args) {  
        String imgPath = "/home/atlas/qrcode.png";  
  
        String content = "中国人";   
  
        encodeQr(content, imgPath);  
        System.out.println("encode success");  
    }  
Ykkkr 发表于 2021-3-24 16:37
com.swetake.util.Qrcode是www.swetake.com上的开源项目,你可以找到jar包的
 楼主| zs8005 发表于 2021-3-24 16:51
Ykkkr 发表于 2021-3-24 16:36
0
昨天刚做了一个,玩了一把。下面是生成二维码的代码

我看不懂啊 小白我是 有简单方法不
Ykkkr 发表于 2021-3-24 17:00
zs8005 发表于 2021-3-24 16:51
我看不懂啊 小白我是 有简单方法不

https://zhuanlan.zhihu.com/p/165361674
这里是教程   由于腾讯打击营销  只能比较复杂
sohuso 发表于 2021-3-24 17:01
自己的二维码截图后存储JPG文件,头像更换成这个文件就行了
 楼主| zs8005 发表于 2021-3-24 17:04
Ykkkr 发表于 2021-3-24 17:00
https://zhuanlan.zhihu.com/p/165361674
这里是教程   由于腾讯打击营销  只能比较复杂

能上穿到微信头像吗? 帮我做一个有偿
vikin 发表于 2021-3-24 17:09
图片融合二维码一般就可以过检测了
网页版可以用:http://www.iqrcode.cn/artqrcode.aspx
安卓APP有:Qart二维码APP    ---这个效果更好一些
 楼主| zs8005 发表于 2021-3-24 17:22
sohuso 发表于 2021-3-24 17:01
自己的二维码截图后存储JPG文件,头像更换成这个文件就行了

也提示完全提醒不行
 楼主| zs8005 发表于 2021-3-24 17:31
vikin 发表于 2021-3-24 17:09
图片融合二维码一般就可以过检测了
网页版可以用:http://www.iqrcode.cn/artqrcode.aspx
安卓APP有:Qar ...

不是图片融合二维码 是二维码能上传到微信头像
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-6-17 16:31

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表