次の方法で共有


DrawingAttributes コンストラクタ (Pen)

指定した Pen オブジェクトの色と幅を使用して、DrawingAttributes クラスの新しいインスタンスを初期化します。

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

構文

'宣言
Public Sub New ( _
    pen As Pen _
)
'使用
Dim pen As Pen

Dim instance As New DrawingAttributes(pen)
public DrawingAttributes(
    Pen pen
)
public:
DrawingAttributes(
    Pen^ pen
)
public DrawingAttributes(
    Pen pen
)
public function DrawingAttributes(
    pen : Pen
)

パラメータ

解説

ストロークの描画属性を変更する場合は、毎回新しいオブジェクトを作成するのではなく、既存の DrawingAttributes オブジェクトを再利用してみてください。新しい DrawingAttributes オブジェクトを作成すると、DrawingAttributes オブジェクトの有効期間を超えて、Ink オブジェクトに残されたメモリが割り当てられます。

この C# の例では、Color プロパティと Width プロパティをペン thickRedPen の色と幅に設定して、DrawingAttributes クラス theDrawingAttributes の新しいインスタンスを初期化します。

Pen thickRedPen = new Pen(Color.Red, 200);
DrawingAttributes theDrawingAttributes = new DrawingAttributes(thickRedPen);

この Microsoft Visual Basic .NET の例では、Color プロパティと Width プロパティをペン thickRedPen の色と幅に設定して、DrawingAttributes クラス theDrawingAttributes の新しいインスタンスを初期化します。

Dim thickRedPen As New Pen(Color.Red, 200)
Dim theDrawingAttributes As New DrawingAttributes(thickRedPen)

プラットフォーム

Windows Vista

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

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

DrawingAttributes クラス

DrawingAttributes メンバ

DrawingAttributes オーバーロード

Microsoft.Ink 名前空間

DrawingAttributes