C# 生成二维码

点击打开链接 二维码生成类库官网
    private Texture2D encoded;

    private void BuileQrCode(string Lastresult)
    {
        encoded = new Texture2D(256, 256);

     
        var textForEncoding = Lastresult;
        if (textForEncoding != null)
        {
            var color32 = Encode(textForEncoding, encoded.width, encoded.height);
            encoded.SetPixels32(color32);
            encoded.Apply();

        }
    }



    private static Color32[] Encode(string textForEncoding, int width, int height)
    {
        var writer = new BarcodeWriter
        {
            Format = BarcodeFormat.QR_CODE,
            Options = new QrCodeEncodingOptions
            {
                Height = height,
                Width = width
            }
        };
        return writer.Write(textForEncoding);
    }

阅读更多
上一篇C#建造者模式
下一篇unity 截图
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭