// 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; }
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); }
public static string Decode(Texture2D tex) { var result = QRCodeProcessor.Decode(tex); if (result != null && result.Text != null) { return(result.Text); } return(null); }
public static Texture2D Encode(string msg, int width, int height, ErrorCorrectionType type) { return(QRCodeProcessor.Encode(msg, width, height, ErrorCorrectionLevelList[(int)type], null)); }