Example #1
0
 public async Task <QrResult> Decode(string imageUrl)
 {
     return(await Task.Run(() => {
         return new QrResult()
         {
             Text = ColorZXingBasic.Decode(new Uri(imageUrl))
         };
     }));
 }
Example #2
0
        public void TestBasic()
        {
            string filePath = TestUtils.GetFilePath("basic.png");

            var bitmapWrite = ColorZXingBasic.Encode(TestUtils.TextLong, 400, 400, 0);

            ColorZXing.Utils.WriteBitMap(bitmapWrite, filePath, ImageFormat.Png);

            var bitmapRead = ColorZXing.Utils.ReadBitMap(filePath);
            var txtDecoded = ColorZXingBasic.Decode(bitmapRead);

            Assert.AreEqual(TestUtils.TextLong, txtDecoded);
        }
Example #3
0
        public void TestBasicUri()
        {
            var textDecoded = ColorZXingBasic.Decode(new Uri("https://raw.githubusercontent.com/HainanZhao/ColorZXing.Net/master/Images/basic.png"));

            Assert.AreEqual(TestUtils.TextLong, textDecoded);
        }