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