CustomLineCap.Clone メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CustomLineCap.Clone メソッドの意味・解説 

CustomLineCap.Clone メソッド

対象の CustomLineCap の同一コピー作成します

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

使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベントオブジェクトである PaintEventArgse が必要です。このコード次のアクション実行します

Public Sub CloneExample(e As
 PaintEventArgs)
 Dim points As Point() = New
 Point(- 5, - 5) New Point(0, 0) _
 New Point(5, - 5)
 Dim capPath As New GraphicsPath()
 ' Create a Path and add two lines to it,
 ' forming a custom line cap.
 capPath.AddLines(points)
 ' Create a CustomLineCap object.
 Dim firstCap As New CustomLineCap(Nothing,
 capPath)
 ' Create a copy of firstCap.
 Dim secondCap As CustomLineCap = CType(firstCap.Clone(),
 _
 CustomLineCap)
 ' Create a Pen object.
 Dim pen As New Pen(Color.Black,
 3F)
 'Set up the line.
 Dim point1 As New Point(20,
 20)
 Dim point2 As New Point(100,
 100)
 ' Set up the caps.
 pen.CustomStartCap = firstCap
 pen.CustomEndCap = secondCap
 ' Draw the line and caps to the screen.
 e.Graphics.DrawLine(pen, point1, point2)
 End Sub
private void CloneExample(PaintEventArgs e)
 {
 // Create a Path and add two lines to it,
 // forming a custom line cap.
 Point[] points =
 {
 new Point(-5, -5),
 new Point(0, 0),
 new Point(5, -5)
 };
 GraphicsPath capPath = new GraphicsPath();
 capPath.AddLines(points);
 // Create a CustomLineCap object.
 CustomLineCap firstCap = new CustomLineCap(null,
 capPath);
 // Create a copy of firstCap.
 CustomLineCap secondCap = (CustomLineCap)firstCap.Clone();
 // Create a Pen object.
 Pen pen = new Pen(Color.Black, 3.0f);
 // Set up the line.
 Point point1 = new Point(20, 20);
 Point point2 = new Point(100, 100);
 // Set up the caps.
 pen.CustomStartCap = firstCap;
 pen.CustomEndCap = secondCap;
 // Draw the line and caps to the screen.
 e.Graphics.DrawLine(pen, point1, point2);
 }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CustomLineCap クラス
CustomLineCap メンバ
System.Drawing.Drawing2D 名前空間



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

辞書ショートカット

すべての辞書の索引

CustomLineCap.Clone メソッドのお隣キーワード
検索ランキング

   

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



CustomLineCap.Clone メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS