internal static WriteableBitmap readImage(String directory, String fileName) { var path = AbstractBlackBoxTestCase.buildTestBase(directory); var image = new WriteableBitmap(0, 0); image.SetSource(File.OpenRead(Path.Combine(path, fileName))); return(image); }
public void testMulti() { // Very basic test for now var testBase = AbstractBlackBoxTestCase.buildTestBase("test/data/blackbox/multi-1"); var source = new BitmapLuminanceSource((Bitmap)Bitmap.FromFile(Path.Combine(testBase, "1.png"))); var bitmap = new BinaryBitmap(new HybridBinarizer(source)); var reader = new GenericMultipleBarcodeReader(new MultiFormatReader()); var results = reader.decodeMultiple(bitmap); Assert.IsNotNull(results); Assert.AreEqual(2, results.Length); Assert.AreEqual("031415926531", results[0].Text); Assert.AreEqual(BarcodeFormat.UPC_A, results[0].BarcodeFormat); Assert.AreEqual("www.airtable.com/jobs", results[1].Text); Assert.AreEqual(BarcodeFormat.QR_CODE, results[1].BarcodeFormat); }
internal static Bitmap readImage(String directory, String fileName) { var path = AbstractBlackBoxTestCase.buildTestBase(directory); return(new Bitmap(Image.FromFile(Path.Combine(path, fileName)))); }