次の方法で共有


InkOverlaySelectionResizingEventArgs.NewPixelRect プロパティ

SelectionResizing イベント発生後の、選択範囲に外接する四角形を Rectangle 構造体として取得します。

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

構文

'宣言
Public ReadOnly Property NewPixelRect As Rectangle
'使用
Dim instance As InkOverlaySelectionResizingEventArgs
Dim value As Rectangle

value = instance.NewPixelRect
public Rectangle NewPixelRect { get; }
public:
property Rectangle NewPixelRect {
    Rectangle get ();
}
/** @property */
public Rectangle get_NewPixelRect()
public function get NewPixelRect () : Rectangle

プロパティ値

型 : System.Drawing.Rectangle
SelectionResizing イベント発生後の選択範囲のサイズ。

解説

NewPixelRect プロパティは、InkOverlaySelectionResizingEventArgs イベントに関する固有の情報を表します。

ms582155.alert_note(ja-jp,VS.90).gifメモ :

この Rectangle 構造体は、クライアント ウィンドウ座標で指定されるので、縦横比を維持してサイズを変更するといったシナリオにも対応できます。

この例では、SelectionResizing イベント ハンドラが、サイズの変更前に選択を調べます。一部がウィンドウの境界の外側になるように選択のサイズが変更される場合、イベント ハンドラは、選択された各 Stroke オブジェクトの Color プロパティを変更し、選択を赤で表示します。

Private Sub mInkObject_SelectionResizing(ByVal sender As Object, ByVal e As InkOverlaySelectionResizingEventArgs)
    If e.NewPixelRect.Left < 0 Or e.NewPixelRect.Top < 0 Or _
       e.NewPixelRect.Right > mInkObject.AttachedControl.ClientRectangle.Width Or _
       e.NewPixelRect.Bottom > mInkObject.AttachedControl.ClientRectangle.Height Then

        For Each stroke As Stroke In mInkObject.Selection
            ' change the stroke color
            stroke.DrawingAttributes.Color = Color.Red
        Next

    End If
End Sub
private void mInkObject_SelectionResizing(object sender, InkOverlaySelectionResizingEventArgs e)
{
    if (e.NewPixelRect.Left < 0 || e.NewPixelRect.Top < 0 ||
        e.NewPixelRect.Right > mInkObject.AttachedControl.ClientRectangle.Width ||
        e.NewPixelRect.Bottom > mInkObject.AttachedControl.ClientRectangle.Height)
    {
        foreach (Stroke stroke in mInkObject.Selection)
        {
            // change the stroke color
            stroke.DrawingAttributes.Color = Color.Red;
        }
    }

}

プラットフォーム

Windows Vista

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

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

InkOverlaySelectionResizingEventArgs クラス

InkOverlaySelectionResizingEventArgs メンバ

Microsoft.Ink 名前空間

InkOverlay

InkOverlay.SelectionResizing