次の方法で共有


RecognizerGuide.WritingBox プロパティ

実際に手書きを行うことができる認識ガイドの、表示されない手書き領域を取得または設定します。

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

構文

'宣言
Public Property WritingBox As Rectangle
'使用
Dim instance As RecognizerGuide
Dim value As Rectangle

value = instance.WritingBox

instance.WritingBox = value
public Rectangle WritingBox { get; set; }
public:
property Rectangle WritingBox {
    Rectangle get ();
    void set (Rectangle value);
}
/** @property */
public Rectangle get_WritingBox()
/** @property */
public  void set_WritingBox(Rectangle value)
public function get WritingBox () : Rectangle
public function set WritingBox (value : Rectangle)

プロパティ値

型 : System.Drawing.Rectangle
インク空間座標における、ガイド ボックスの四角形の手書き領域。

解説

手書きボックスには、描画ボックスの外側に手書きを行うユーザーのために許容誤差が用意されています。これは、タブレットの画面に物理的に描画される線で、ユーザーはその中で手書きを行います。描画ボックスを設定するには、DrawnBox プロパティを使用します。

この例では、RecognizerContext オブジェクトがインスタンス化され、新しい RecognizerGuide オブジェクトを作成することによって Guide プロパティに割り当てられます。

' create a new RecognizerContext object
mRecognizerContext = New RecognizerContext()
' if the Recognizer supports LinedInput, set the Guide
If (mRecognizerContext.Recognizer.Capabilities And RecognizerCapabilities.LinedInput) <> 0 Then
    ' get the lower right corner in pixel units
    Dim lowerRight As Point = New Point(mInkOverlay.AttachedControl.Width, mInkOverlay.AttachedControl.Height)
    ' convert to ink space units
    mInkOverlay.Renderer.PixelToInkSpace(Me.CreateGraphics(), lowerRight)
    ' create Rectangles
    Dim writingBox As Rectangle = New Rectangle(0, 0, lowerRight.X, lowerRight.Y)
    Dim drawnBox As Rectangle = New Rectangle(0, 0, lowerRight.X, lowerRight.Y)
    ' shrink drawn box relative to writing box
    drawnBox.Inflate(-100, -100)
    ' create Guide with 8 rows, zero columns, and no midline
    Dim guide As RecognizerGuide = New RecognizerGuide(8, 0, 0, writingBox, drawnBox)
    mRecognizerContext.Guide = guide
End If
// create a new RecognizerContext object
mRecognizerContext = new RecognizerContext();
// if the Recognizer supports LinedInput, set the Guide
if ((mRecognizerContext.Recognizer.Capabilities & RecognizerCapabilities.LinedInput) != 0)
{
    // get the lower right corner in pixel units
    Point lowerRight = new Point(mInkOverlay.AttachedControl.Width, mInkOverlay.AttachedControl.Height);
    // convert to ink space units
    mInkOverlay.Renderer.PixelToInkSpace(this.CreateGraphics(), ref lowerRight);
    // create Rectangles
    Rectangle writingBox = new Rectangle(0, 0, lowerRight.X, lowerRight.Y);
    Rectangle drawnBox = new Rectangle(0, 0, lowerRight.X, lowerRight.Y);
    // shrink drawn box relative to writing box
    drawnBox.Inflate(-100, -100);
    // create Guide with 8 rows, zero columns, and no midline
    RecognizerGuide guide = new RecognizerGuide(8, 0, 0, writingBox, drawnBox);
    mRecognizerContext.Guide = guide;
}

プラットフォーム

Windows Vista

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

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

RecognizerGuide 構造体

RecognizerGuide メンバ

Microsoft.Ink 名前空間

RecognizerGuide.DrawnBox