ClaimedBarcodeScanner 類別

定義

表示宣告的條碼掃描器。

public ref class ClaimedBarcodeScanner sealed : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ClaimedBarcodeScanner final : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class ClaimedBarcodeScanner final : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ClaimedBarcodeScanner : System.IDisposable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class ClaimedBarcodeScanner : System.IDisposable
Public NotInheritable Class ClaimedBarcodeScanner
Implements IDisposable
繼承
Object Platform::Object IInspectable ClaimedBarcodeScanner
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

當 ClaimScannerAsync方法完成時,就會建立 物件。

版本歷程記錄

Windows 版本 SDK 版本 新增值
1703 15063 GetSymbologyAttributesAsync
1703 15063 SetSymbologyAttributesAsync
1803 17134 HideVideoPreview
1803 17134 IsVideoPreviewShownOnEnable
1803 17134 ShowVideoPreviewAsync
1809 17763 已關閉

屬性

DeviceId

取得所宣告條碼掃描器的 DeviceInformation.Id

IsDecodeDataEnabled

取得或設定布林值,指出是否要將解碼的資料提供給服務物件。

IsDisabledOnDataReceived

取得或設定布林值,指出是否在接收資料之後停用條碼掃描器。

IsEnabled

指出條碼掃描器是否可以接收 DataReceived 事件。

IsVideoPreviewShownOnEnable

取得或設定是否要在啟用條碼掃描器時顯示影片預覽視窗。

方法

Close()

釋放條碼掃描器的獨佔宣告。 針對 C++ 和 JavaScript,請使用 Close () 。 針對 C# 和 Visual Basic,請使用 Dispose () 。

DisableAsync()

將條碼掃描器放入無法接收 DataReceived 事件的狀態。

Dispose()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。

EnableAsync()

取得條碼掃描器為 DataReceived 事件的就緒狀態。

GetSymbologyAttributesAsync(UInt32)

取得指定條碼符號制的屬性。

HideVideoPreview()

隱藏影片預覽視窗。

ResetStatisticsAsync(IIterable<String>)

針對可重設的所有統計資料,將指定的統計資料重設為零。

RetainDevice()

保留條碼掃描器的獨佔宣告。

SetActiveProfileAsync(String)

設定條碼掃描器上的使用中設定檔。

重要

此 API 僅適用于適用于適用于 UWP) 的 Windows 行動裝置系列組建 10240 和組建 10586 (Windows Mobile Extensions。 此 API 不適用於 Windows 桌面裝置系列、其他裝置系列,或適用于 10240 和 10586 以外的 Windows Mobile 組建。 在作業系統上呼叫 (作業系統) 不適用時,此 API 的行為是未定義的。 如需裝置系列的詳細資訊,請參閱 裝置系列擴充功能和 API 合約

SetActiveSymbologiesAsync(IIterable<UInt32>)

設定要使用的裝置條碼符號。

SetSymbologyAttributesAsync(UInt32, BarcodeSymbologyAttributes)

設定所宣告條碼掃描器所使用的條碼符號系統屬性。

ShowVideoPreviewAsync()

顯示影片預覽視窗。

StartSoftwareTriggerAsync()

用來向條碼掃描器發出訊號以開始掃描。 在 叫用 StopSoftwareTriggerAsync 之前,或直到掃描器自行結束會話為止,會話才會處於作用中狀態。

StopSoftwareTriggerAsync()

用來停止以 StartSoftwareTriggerAsync啟動的會話。 如果沒有使用中的會話,則不會引發任何錯誤。

UpdateStatisticsAsync(IIterable<KeyValuePair<String,String>>)

更新指定的統計資料。

事件

Closed

當 ClaimedBarcodeScanner關閉時所引發的事件。

DataReceived

當裝置掃描條碼時發生。

ErrorOccurred

發生于讀取條碼時發生問題。

ImagePreviewReceived

當裝置收到掃描的點陣圖影像時發生。

ReleaseDeviceRequested

發生于裝置取得釋放其獨佔宣告的要求時。

TriggerPressed

在掃描工作期間按下條碼掃描器觸發程式或按鈕時發生。

TriggerReleased

在掃描工作期間釋放條碼掃描器觸發程式或按鈕時發生。

適用於

另請參閱