XMConvertFloatToHalfStream
XMConvertHalfToFloatStream
XMMatrixDecompose
XMPlaneTransformStream
XMVector2TransformCoordStream
XMVector2TransformNormalStream
XMVector2TransformStream
XMVector3ProjectStream
XMVector3TransformCoordStream
XMVector3TransformNormalStream
XMVector3TransformStream
XMVector3UnprojectStream
XMVector4TransformStream
Expand Minimize

ID2D1GeometrySink interface

Describes a geometric path that can contain lines, arcs, cubic Bezier curves, and quadratic Bezier curves.

When to implement

Implement this interface when you want to read back the complete contents of a geometry. For other scenarios, use the implementation provided by Direct2D.

Members

The ID2D1GeometrySink interface inherits from ID2D1SimplifiedGeometrySink. ID2D1GeometrySink also has these types of members:

Methods

The ID2D1GeometrySink interface has these methods.

MethodDescription
AddArc Overloaded.

Creates a single arc and adds it to the path geometry.

AddBezier Overloaded.

Creates a cubic Bezier curve between the current point and the specified end point and adds it to the geometry sink.

AddLine

Creates a line segment between the current point and the specified end point and adds it to the geometry sink.

AddQuadraticBezier Overloaded.

Creates a quadratic Bezier curve between the current point and the specified end point and adds it to the geometry sink.

AddQuadraticBeziers

Adds a sequence of quadratic Bezier segments as an array in a single call.

 

Remarks

The ID2D1GeometrySink interface extends the ID2D1SimplifiedGeometrySink interface to add support for arcs and quadratic beziers, as well as functions for adding single lines and cubic beziers.

A geometry sink consists of one or more figures. Each figure is made up of one or more line, curve, or arc segments. To create a figure, call the BeginFigure method, specify the figure's start point, and then use its Add methods (such as AddLine and AddBezier) to add segments. When you are finished adding segments, call the EndFigure method. You can repeat this sequence to create additional figures. When you are finished creating figures, call the Close method.

Examples

The following example creates an ID2D1PathGeometry, retrieves a sink, and uses it to define an hourglass shape. For the complete example, see How to Draw and Fill a Complex Shape.


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


Requirements

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

D2d1.h

Library

D2d1.lib

DLL

D2d1.dll

See also

Geometries Overview
How to Draw and Fill a Complex Shape

 

 

Community Additions

ADD
Show:
© 2014 Microsoft