Pen.StartCap プロパティとは? わかりやすく解説

Pen.StartCap プロパティ

この Pen描画され直線始点使用するキャップ スタイル取得または設定します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Property StartCap As
 LineCap
Dim instance As Pen
Dim value As LineCap

value = instance.StartCap

instance.StartCap = value
public LineCap StartCap { get; set;
 }
public:
property LineCap StartCap {
    LineCap get ();
    void set (LineCap value);
}
/** @property */
public LineCap get_StartCap ()

/** @property */
public void set_StartCap (LineCap value)
public function get StartCap
 () : LineCap

public function set StartCap
 (value : LineCap)

プロパティ
この Pen描画され直線始点使用されキャップ スタイルを表すいずれかの LineCap 値。

例外例外
例外種類条件

InvalidEnumArgumentException

指定した値が、LineCapメンバではありません。

使用例使用例

次のコード例は、PenStartCap プロパティおよび EndCap プロパティ設定する効果示してます。

この例は、Windows フォームでの使用意図してデザインされています。コードフォーム貼り付けフォームPaint イベント処理するときに PaintEventArgs の e渡して ShowStartAndEndCaps メソッド呼び出します。

Private Sub ShowStartAndEndCaps(ByVal
 e As PaintEventArgs)

    ' Create a new custom pen.
    Dim redPen As New Pen(Brushes.Red,
 6.0F)

    ' Set the StartCap property.
    redPen.StartCap = Drawing2D.LineCap.RoundAnchor

    ' Set the EndCap property.
    redPen.EndCap = Drawing2D.LineCap.ArrowAnchor

    ' Draw a line.
    e.Graphics.DrawLine(redPen, 40.0F, 40.0F, 145.0F, 185.0F)

    ' Dispose of the custom pen.
    redPen.Dispose()

End Sub
private void ShowStartAndEndCaps(PaintEventArgs
 e)
{

    // Create a new custom pen.
    Pen redPen = new Pen(Brushes.Red, 6.0F);

    // Set the StartCap property.
    redPen.StartCap = System.Drawing.Drawing2D.LineCap.RoundAnchor;

    // Set the EndCap property.
    redPen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;

    // Draw a line.
    e.Graphics.DrawLine(redPen, 40.0F, 40.0F, 145.0F, 185.0F);

    // Dispose of the custom pen.
    redPen.Dispose();

}
private:
   void ShowStartAndEndCaps( PaintEventArgs^ e )
   {
      // Create a new custom pen.
      Pen^ redPen = gcnew Pen( Brushes::Red,6.0F );

      // Set the StartCap property.
      redPen->StartCap = System::Drawing::Drawing2D::LineCap::RoundAnchor;

      // Set the EndCap property.
      redPen->EndCap = System::Drawing::Drawing2D::LineCap::ArrowAnchor;

      // Draw a line.
      e->Graphics->DrawLine( redPen, 40.0F, 40.0F, 145.0F, 185.0F );

      // Dispose of the custom pen.
      delete redPen;
   }
private void ShowStartAndEndCaps(PaintEventArgs
 e)
{
    // Create a new custom pen.
    Pen redPen = new Pen(Brushes.get_Red(), 6);

    // Set the StartCap property.
    redPen.set_StartCap(System.Drawing.Drawing2D.LineCap.RoundAnchor);

    // Set the EndCap property.
    redPen.set_EndCap(System.Drawing.Drawing2D.LineCap.ArrowAnchor);

    // Draw a line.
    e.get_Graphics().DrawLine(redPen, 40, 40, 145, 185);

    // Dispose of the custom pen.
    redPen.Dispose();
} //ShowStartAndEndCaps
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

Pen.StartCap プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Pen.StartCap プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS