ID2D1GeometrySink::AddLine メソッド
現在の点と指定された終点との間に線分を作成してジオメトリ シンクに追加します。
構文
virtual void AddLine(
D2D1_POINT_2F point
) = 0;
パラメーター
- point
D2D1_POINT_2F 描画する直線の終点。
戻り値
This は値を返しません。
例
次の例では、ID2D1PathGeometry を作成してシンクを取得し、シンクを使用して砂時計の図形を定義します。完全な例については、「複雑な図形を描画して塗りつぶす方法」を参照してください。
ID2D1GeometrySink *pSink = NULL;
// Create a path geometry.
if (SUCCEEDED(hr))
{
hr = m_pD2DFactory->CreatePathGeometry(&m_pPathGeometry);
if (SUCCEEDED(hr))
{
// Write to the path geometry using the geometry sink.
hr = m_pPathGeometry->Open(&pSink);
if (SUCCEEDED(hr))
{
pSink->BeginFigure(
D2D1::Point2F(0, 0),
D2D1_FIGURE_BEGIN_FILLED
);
pSink->AddLine(D2D1::Point2F(200, 0));
pSink->AddBezier(
D2D1::BezierSegment(
D2D1::Point2F(150, 50),
D2D1::Point2F(150, 150),
D2D1::Point2F(200, 200))
);
pSink->AddLine(D2D1::Point2F(0, 200));
pSink->AddBezier(
D2D1::BezierSegment(
D2D1::Point2F(50, 150),
D2D1::Point2F(50, 50),
D2D1::Point2F(0, 0))
);
pSink->EndFigure(D2D1_FIGURE_END_CLOSED);
hr = pSink->Close();
}
SafeRelease(&pSink);
}
}
要件
クライアントの最小要件 |
Windows 7, Windows Vista SP2 および Windows Vista 用のプラットフォーム更新プログラム |
サーバーの最小要件 |
Windows Server 2008 R2, Windows Server 2008 SP2 および Windows Server 2008 用のプラットフォーム更新プログラム |
ヘッダー |
D2d1.h |
ライブラリ |
D2d1.lib |
DLL |
D2d1.dll |