次の方法で共有


DynamicRenderer コンストラクタ (IntPtr)

DynamicRenderer クラスの新しいインスタンスを初期化します。

名前空間 :  Microsoft.StylusInput
アセンブリ :  Microsoft.Ink (Microsoft.Ink.dll 内)

構文

'宣言
Public Sub New ( _
    handle As IntPtr _
)
'使用
Dim handle As IntPtr

Dim instance As New DynamicRenderer(handle)
public DynamicRenderer(
    IntPtr handle
)
public:
DynamicRenderer(
    IntPtr handle
)
public DynamicRenderer(
    IntPtr handle
)
public function DynamicRenderer(
    handle : IntPtr
)

パラメータ

  • handle
    型 : System.IntPtr
    タブレット ペン データが表示されるコントロール。

解説

通常、DynamicRenderer オブジェクトと RealTimeStylus オブジェクトは同じ Control またはウィンドウ ハンドルで初期化しますが、別のオブジェクトで初期化することも可能です。この例として、ストローク パケットが生成されたウィンドウとは別のウィンドウでインクを表示する場合が挙げられます。

この C# の例では、IStylusAsyncPlugin インターフェイスを実装するフォームの Load イベント用のイベント ハンドラを示します。DynamicRenderer オブジェクト theDynamicRenderer の新しいインスタンスと RealTimeStylus オブジェクト theRealTimeStylus は初期化され、フォームと関連付けられて、有効化されます。

using Microsoft.StylusInput;
// ...
private RealTimeStylus theRealTimeStylus;
private DynamicRenderer theDynamicRenderer;
// ...
private void InkCollection_Load(object sender, System.EventArgs e)
{
    theDynamicRenderer = new DynamicRenderer(Handle);
    theRealTimeStylus = new RealTimeStylus(this, true);

    // Add the dynamic renderer to the synchronous plugin notification chain.
    // Synchronous notifications occur on the pen thread.
    theRealTimeStylus.SyncPluginCollection.Add(theDynamicRenderer);

    // Add the form to the asynchronous plugin notification chain.  This plugin
    // will be used to collect stylus data into an ink object.  Asynchronous
    // notifications occur on the UI thread.
    theRealTimeStylus.AsyncPluginCollection.Add(this);

    // Enable the real time stylus and the dynamic renderer
    theRealTimeStylus.Enabled = true;
    theDynamicRenderer.Enabled = true;  
}

この Microsoft Visual Basic .NET の例では、IStylusAsyncPlugin インターフェイスを実装するフォームの Load イベント用のイベント ハンドラを示します。DynamicRenderer オブジェクト theDynamicRenderer の新しいインスタンスと RealTimeStylus オブジェクト theRealTimeStylus は初期化され、フォームと関連付けられて、有効化されます。

Imports Microsoft.StylusInput
' ...
Private theRealTimeStylus As RealTimeStylus
Private theDynamicRenderer As DynamicRenderer

' ...
Private Sub InkCollector_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
    theDynamicRenderer = New DynamicRenderer(Handle)
    theRealTimeStylus = New RealTimeStylus(Me, True)

    ' Add the dynamic renderer to the synchronous plugin notification chain.
    ' Synchronous notifications occur on the pen thread.
    theRealTimeStylus.SyncPluginCollection.Add(theDynamicRenderer)

    ' Add the form to the asynchronous plugin notification chain.  This plugin
    ' will be used to collect stylus data into an ink object.  Asynchronous
    ' notifications occur on the UI thread.
    theRealTimeStylus.AsyncPluginCollection.Add(Me)

    ' Enable the real time stylus and the dynamic renderer
    theRealTimeStylus.Enabled = True
    theDynamicRenderer.Enabled = True
End Sub

プラットフォーム

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

DynamicRenderer クラス

DynamicRenderer メンバ

DynamicRenderer オーバーロード

Microsoft.StylusInput 名前空間

IStylusAsyncPlugin