インク分析で使用するために、手書き認識エンジンへのアクセスを提供します。
名前空間 : System.Windows.Ink.AnalysisCore
アセンブリ : IACore (IACore.dll 内)
構文
'宣言
Public Class InkRecognizerBase _
Implements IDisposable
'使用
Dim instance As InkRecognizerBase
public class InkRecognizerBase : IDisposable
public ref class InkRecognizerBase : IDisposable
public class InkRecognizerBase implements IDisposable
public class InkRecognizerBase implements IDisposable
解説
認識エンジンには、認識を実行可能にする特定の属性とプロパティがあります。認識エンジンのプロパティは、認識を行う前に決定する必要があります。認識エンジンがサポートするプロパティの種類により、実行可能な認識の種類が決まります。たとえば、認識エンジンが草書体手書きをサポートしない場合、ユーザーが草書体を書いたときに不正確な結果を返します。
認識エンジンには、手書きの多くの特徴を自動的に管理する組み込み機能もあります。たとえば、ストロークが描画される行のメトリックスが決定されます。ストロークの行番号を返すことはできますが、認識エンジンの組み込み機能があるため、それらの行メトリックスを決定する方法を指定する必要はありません。
InkAnalyzerBase は、使用可能な認識エンジンの InkRecognizerBaseCollection を保持します。このコレクションにアクセスするには、InkAnalyzerBase の GetInkRecognizersByPriority メソッドを使用します。
例
次の例では、指定した InkRecognizerBase に関する情報が含まれる文字列を返すメソッドを定義します。リフレクションを使用して InkRecognizerBase の特定の機能およびプロパティに関する情報を返すヘルパ メソッド ListCapabilities および GetPropertyName については、この例には示しません。
''' <summary>
''' Generates a string containing information about the specified InkRecognizer.
''' </summary>
''' <param name="theInkRecognizer">
''' The InkRecognizer from which to gather the information.
''' </param>
''' <returns>
''' A string containing information about the specified InkRecognizer.
''' </returns>
Private Function GetInkRecognizerData( _
ByVal theInkRecognizer As System.Windows.Ink.AnalysisCore.InkRecognizerBase) As String
' Create a StringBuilder in which to collect the information.
Dim result As New System.Text.StringBuilder
' Add the name of the recognizer.
result.AppendLine(String.Format("Name: {0}", theInkRecognizer.Name))
' Add the GUID of the recognizer.
result.AppendLine(String.Format(" Guid: {0}", theInkRecognizer.Guid))
' Add the vendor of the recognizer.
result.AppendLine(String.Format(" Vendor: {0}", theInkRecognizer.Vendor))
' Add the languages the recognizer supports.
result.AppendLine(" Supports the following languages:")
If (0 = theInkRecognizer.GetLanguages().Length) Then
result.AppendLine(" No languages supported.")
Else
For Each lcid As Integer In theInkRecognizer.GetLanguages()
Dim theCultureInfo As New System.Globalization.CultureInfo(lcid)
result.AppendLine(String.Format( _
" 0x{0:x4}: {1}", lcid, theCultureInfo.EnglishName))
Next
End If
' Add the capabilities of the recognizer.
result.AppendLine(String.Format( _
" Capabilities: 0x{0:x}", theInkRecognizer.Capabilities))
' List each capability separately, using a helper method.
result.Append(Me.ListCapabilities(theInkRecognizer.Capabilities))
' Add the properties the recognizer supports.
result.AppendLine(" Supports the following properties:")
If (0 = theInkRecognizer.GetSupportedProperties().Length) Then
result.AppendLine(" No properties supported.")
Else
For Each theGuid As System.Guid In theInkRecognizer.GetSupportedProperties()
' Use the helper method to get the name of the property.
result.AppendLine(" " + Me.GetPropertyName(theGuid))
Next
End If
Return result.ToString()
End Function
/// <summary>
/// Generates a string containing information about the specified InkRecognizer.
/// </summary>
/// <param name="theInkRecognizer">
/// The InkRecognizer from which to gather the information.
/// </param>
/// <returns>
/// A string containing information about the specified InkRecognizer.
/// </returns>
private string GetInkRecognizerData(
System.Windows.Ink.AnalysisCore.InkRecognizerBase theInkRecognizer)
{
// Create a StringBuilder in which to collect the information.
System.Text.StringBuilder result = new System.Text.StringBuilder();
// Add the name of the recognizer.
result.AppendLine(string.Format(
"Name: {0}", theInkRecognizer.Name));
// Add the GUID of the recognizer.
result.AppendLine(string.Format(
" Guid: {0}", theInkRecognizer.Guid));
// Add the vendor of the recognizer.
result.AppendLine(string.Format(
" Vendor: {0}", theInkRecognizer.Vendor));
// Add the languages the recognizer supports.
result.AppendLine(" Supports the following languages:");
if (0 == theInkRecognizer.GetLanguages().Length)
{
result.AppendLine(" No languages supported.");
}
else
{
foreach (int lcid in theInkRecognizer.GetLanguages())
{
System.Globalization.CultureInfo theCultureInfo =
new System.Globalization.CultureInfo(lcid);
result.AppendLine(string.Format(
" 0x{0:x4}: {1}", lcid, theCultureInfo.EnglishName));
}
}
// Add the capabilities of the recognizer.
result.AppendLine(string.Format(
" Capabilities: 0x{0:x}", theInkRecognizer.Capabilities));
// List each capability separately, using a helper method.
result.Append(this.ListCapabilities(theInkRecognizer.Capabilities));
// Add the properties the recognizer supports.
result.AppendLine(" Supports the following properties:");
if (0 == theInkRecognizer.GetSupportedProperties().Length)
{
result.AppendLine(" No properties supported.");
}
else
{
foreach (System.Guid theGuid in theInkRecognizer.GetSupportedProperties())
{
// Use the helper method to get the name of the property.
result.AppendLine(" " + this.GetPropertyName(theGuid));
}
}
return result.ToString();
}
継承階層
System.Object
System.Windows.Ink.AnalysisCore.InkRecognizerBase
スレッド セーフ
この型のすべてのパブリック static (Visual Basic では Shared) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォーム
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0
参照
参照
System.Windows.Ink.AnalysisCore 名前空間
System.Windows.Ink.AnalysisCore.InkRecognizerBaseCollection
System.Windows.Ink.AnalysisHintNode
System.Windows.Ink.AnalysisCore.PropertyGuidsForAnalysisHintsBase