Windows 8.1 にネイティブ/ビルトイン バーコード スキャナーが同梱されているかどうか、または開発用にサード パーティのライブラリが必要かどうか知っていますか?
2480 次
2 に答える
3
はい、 Windows8.1 で利用可能なBarCodeScannerクラスがあります (ただし、Windows 8 では利用できません)。
MSDN にもコード サンプルがあります - http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.pointofservice.barcodescanner.aspx
于 2013-11-07T17:02:48.933 に答える
2
いいえ、Windows 8 にはバーコード認識のサポートが組み込まれていません。購入できる安価なライブラリがいくつかあります。また、いくつかのオープンソース プロジェクトもあります。
職場ではNeoDynamic Barcodeを使用しています。
これは、Windows 8 でバーコード リーダーを読み取る方法のコードの一部です。
var ccu = new Windows.Media.Capture.CameraCaptureUI();
ccu.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
ccu.PhotoSettings.MaxResolution = CameraCaptureUIMaxPhotoResolution.HighestAvailable;
Windows.Storage.StorageFile x = await ccu.CaptureFileAsync(CameraCaptureUIMode.Photo);
//FileOpenPicker fop = new FileOpenPicker();
//fop.FileTypeFilter.Add(".jpg");
//StorageFile x = await fop.PickSingleFileAsync();
if (x != null)
{
ZXing.BarcodeReader br = new ZXing.BarcodeReader();
WriteableBitmap wrb;
BitmapImage img = new BitmapImage();
img.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
using (IRandomAccessStream fileStream = await x.OpenAsync(FileAccessMode.Read))
{
//fileStream.
wrb = await BitmapFactory.New(1, 1).FromStream(fileStream);
}
var res = br.Decode(wrb);
testImage.Source = wrb;
//System.Diagnostics.Debug.WriteLine("ISBN = " + res.ToString());
}
完全な参照: http://zxingnet.codeplex.com/discussions/393332
注: http://zxingnet.codeplex.com/から参照 zxing.winrt および WriteableBitmapEx.WinRT を追加してください。
于 2013-09-20T14:08:37.773 に答える