0
我想在Windows 8应用程序中使用xaml C#读取QR码/条码,任何指针?在Windows 8应用程序中读取QR码/条码
这个我试过用ZXing.Net
var openPicker = new FileOpenPicker { ViewMode = PickerViewMode.Thumbnail, SuggestedStartLocation = PickerLocationId.PicturesLibrary };
openPicker.FileTypeFilter.Add(".jpg");
openPicker.FileTypeFilter.Add(".jpeg");
openPicker.FileTypeFilter.Add(".png");
StorageFile file = await openPicker.PickSingleFileAsync();
if (file != null)
{
// Application now has read/write access to the picked file
BitmapImage bmp = new BitmapImage();
IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);
bmp.SetSource(stream);
BarCodeImage.Source = bmp;
IBarcodeReader reader = new BarcodeReader();
WriteableBitmap barcodeBitmap = new WriteableBitmap(1,1);
barcodeBitmap.SetSource(stream);
var result = reader.Decode(barcodeBitmap);
}
但在加载结果我得到异常“值不能为空”。请帮助应该是什么它
尝试制作和精力首先,有大量的信息,并了解这应该是能够帮助你。另外,将问题标记为C#而不是放在标题中。 FAQ http://stackoverflow.com/faq可能会派上用场...... – Kobunite 2013-05-09 09:11:44