Feb 27, 2011 at 7:56 PM
Edited Feb 27, 2011 at 7:59 PM
WP7BarcodeManager.ScanBarcode(new Uri("icons/Sample_Email.png", UriKind.Relative), BarcodeResults_Finished);
This method will create a new BitmapImage for the given URI. BitmapImages can only be created from the UI thread, so need to make sure you may need to schedule it using the dispatcher. I'll look at adding a an auto-fix for this in the next release.
WP7BarcodeManager.ScanBarcode(new BitmapImage(new Uri("icons/Sample_Email.png", UriKind.Relative)), BarcodeResults_Finished);
This method requires that the bitmap image has already been initialized. Try using this before passing image into the method:
var bi = new BitmapImage(UriBarcode);
bi.CreateOptions = BitmapCreateOptions.None;
Glad you found a way to get it to work. The next version has a ScanBarcodeSync method that takes a BitmapImage stream and returns the results synchronously instead of asynchronously. This was added as part of a testing framework that is still being developed.