This project has moved and is read-only. For the latest updates, please go here.

Not having good results

Aug 27, 2015 at 3:29 PM
Edited Aug 27, 2015 at 3:30 PM
I'm not getting good reads, just results of null. I can't see why exactly.

If I use one of the supplied encoder tools, and save that image, that reads. If I take a nice picture of one, it never reads, no matter how I crop, contrast enhance or straighten it.

I'm open to any tips. Here is a typical image that won't read. It is supposed to be a '3' (not sure how to upload an image here directly or I would)

http://imgur.com/ewtvwE5

I'm trying to use this code block to load and read it:
``` `
        string fileToLaunch = @"Assets\13.png";
        var storageFile = await Package.Current.InstalledLocation.GetFileAsync(fileToLaunch);
        var stream = await storageFile.OpenReadAsync();
        stream.Seek(0);

        // find out how big the image is, don't need this if you already know
        var bm = new BitmapImage();
        await bm.SetSourceAsync(stream);

        var wb = new WriteableBitmap(bm.PixelWidth, bm.PixelHeight);
        stream.Seek(0);
        await wb.SetSourceAsync(stream);

        reader.AutoRotate = true;
        reader.Options.TryHarder = true;
        reader.Options.PureBarcode = true;

        var result = reader.Decode(wb);
        //
        if (result != null)
            tb_infoText.Text = result.ToString();``