API:Vcl.Direct2D.TDirect2DCanvas.Polyline

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

procedure Polyline(const Points: array of TPoint); override;

C++

virtual void __fastcall Polyline(const System::Types::TPoint *Points, const int Points_High);

プロパティ

種類 可視性 ソース ユニット
procedure
function
public
Vcl.Direct2D.pas
Vcl.Direct2D.hpp
Vcl.Direct2D TDirect2DCanvas

説明

Points に渡された各点をつなげて、現在のペンでキャンバスに一連の直線を描画します。

Vcl.Direct2D.TDirect2DCanvas.Polyline は Vcl.Graphics.TCustomCanvas.Polyline を継承しています。以下の内容はすべて Vcl.Graphics.TCustomCanvas.Polyline を参照しています。

Points に渡された各点をつなげて、現在のペンでキャンバスに一連の直線を描画します。

キャンバス上で点を結んだ一連の直線の描画を実装するために Polyline メソッドをオーバーライドします。2 点だけを指定すると、Polyline により 1 本の直線が描画されます。

Points パラメータは、接続する点の配列です。

メモ:  Delphi では、Slice 関数を使用して、点の配列の一部を Polyline メソッドに渡すことができます。たとえば、100 点の配列から最初の 10 点をつなげて一連の直線を形成するには、Slice 関数を次のとおり使用します。Canvas.Polyline(Slice(PointArray, 10));

1 番目の点の値で MoveTo 関数を呼び出してから、後続のすべての点で LineTo を繰り返し呼び出すと、キャンバスに同じ図形を描画できます。ただし、LineTo と異なり、Polyline では PenPos の値が変更されません。

関連項目