Scan image from library

Apr 29, 2012 at 11:09 AM

The sample works fine for me where it loads the sample images from a URL, and returns the result. But I am trying to bring up the PhotoChooser and select a photo of a QR Code, but it always fails. This seems like a bug.

 

 void photoSelection_Completed(object sender, PhotoResult e)
        {
            if (e.TaskResult == TaskResult.OK)
            {
                BitmapImage bitmap = new BitmapImage { CreateOptions = BitmapCreateOptions.None };
                bitmap.SetSource(e.ChosenPhoto);
                
             WP7BarcodeManager.ScanMode = BarcodeFormat.QR_CODE;
                WP7BarcodeManager.ScanBarcode(bitmap, Barcode_Results);
            }
            else if (e.TaskResult == TaskResult.None)
            {
                MessageBox.Show(e.Error.Message, "There was an error", MessageBoxButton.OK);
            }
        }

When it gets back to the Barcode_Results delegate it says "Error: Cannot decode barcode image. Please make sure scan mode is correct and try again.".

Thanks!