Partager via


ID2D1SimplifiedGeometrySink ::BeginFigure, méthode (d2d1.h)

Démarre une nouvelle figure au point spécifié.

Syntaxe

void BeginFigure(
  D2D1_POINT_2F     startPoint,
  D2D1_FIGURE_BEGIN figureBegin
);

Paramètres

startPoint

Type : D2D1_POINT_2F

Point auquel commencer la nouvelle figure.

figureBegin

Type : D2D1_FIGURE_BEGIN

Indique si la nouvelle figure doit être creuse ou remplie.

Valeur de retour

None

Remarques

Si cette méthode est appelée alors qu’une figure est en cours, l’interface est invalidée et toutes les méthodes futures échouent.

Exemples

L’exemple suivant crée un ID2D1PathGeometry, récupère un récepteur et l’utilise pour définir une forme de sablier.

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);
    }
}

Configuration requise

Condition requise Valeur
Client minimal pris en charge Windows 7, Windows Vista avec SP2 et Mise à jour de plateforme pour Windows Vista [applications de bureau | Applications UWP]
Serveur minimal pris en charge Windows Server 2008 R2, Windows Server 2008 avec SP2 et Platform Update pour Windows Server 2008 [applications de bureau | Applications UWP]
Plateforme cible Windows
En-tête d2d1.h
Bibliothèque D2d1.lib
DLL D2d1.dll

Voir aussi

ID2D1SimplifiedGeometrySink

Vue d’ensemble des géométries de chemin