public async Task <QrResult> Decode(string imageUrl) { return(await Task.Run(() => { return new QrResult() { Text = ColorZXingBasic.Decode(new Uri(imageUrl)) }; })); }
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); }
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); }