コード例 #1
0
    // generate texture -- convert to sprite -- feed to image
    public void Encode_QR(string _URL)
    {
        Texture2D tx = QRCodeProcessor.Encode(_URL, 512, 512);

        Sprite sp = Sprite.Create(tx, new Rect(0, 0, 512, 512), new Vector2(0f, 0f));

        _QRImage.sprite = sp;
    }
コード例 #2
0
        private bool DetectQRCodeInFrame(SoftwareBitmap bitmap)
        {
            SoftwareBitmap convertedSource = SoftwareBitmap.Convert(bitmap, BitmapPixelFormat.Nv12);

            this.qrCodeProcessor = new QRCodeProcessor();
            this.detctedQRCode   = qrCodeProcessor.DecodeQRCodes(convertedSource);

            return(this.detctedQRCode != null);
        }
コード例 #3
0
        public static string Decode(Texture2D tex)
        {
            var result = QRCodeProcessor.Decode(tex);

            if (result != null && result.Text != null)
            {
                return(result.Text);
            }

            return(null);
        }
コード例 #4
0
 public static Texture2D Encode(string msg, int width, int height, ErrorCorrectionType type)
 {
     return(QRCodeProcessor.Encode(msg, width, height, ErrorCorrectionLevelList[(int)type], null));
 }