CD2DPathGeometry Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CD2DPathGeometry Class.

A wrapper for ID2D1PathGeometry.

class CD2DPathGeometry : public CD2DGeometry;  

Public Constructors

NameDescription
CD2DPathGeometry::CD2DPathGeometryConstructs a CD2DPathGeometry object.

Public Methods

NameDescription
CD2DPathGeometry::AttachAttaches existing resource interface to the object
CD2DPathGeometry::CreateCreates a CD2DPathGeometry. (Overrides CD2DResource::Create.)
CD2DPathGeometry::DestroyDestroys a CD2DPathGeometry object. (Overrides CD2DGeometry::Destroy.)
CD2DPathGeometry::DetachDetaches resource interface from the object
CD2DPathGeometry::GetFigureCountRetrieves tthe number of figures in the path geometry.
CD2DPathGeometry::GetSegmentCountRetrieves the number of segments in the path geometry.
CD2DPathGeometry::OpenRetrieves the geometry sink that is used to populate the path geometry with figures and segments.
CD2DPathGeometry::StreamCopies the contents of the path geometry to the specified ID2D1GeometrySink.

Protected Data Members

NameDescription
CD2DPathGeometry::m_pPathGeometryA pointer to an ID2D1PathGeometry.

CObject

CD2DResource

CD2DGeometry

CD2DPathGeometry

Header: afxrendertarget.h

Attaches existing resource interface to the object

void Attach(ID2D1PathGeometry* pResource);

Parameters

pResource
Existing resource interface. Cannot be NULL

Constructs a CD2DPathGeometry object.

CD2DPathGeometry(
    CRenderTarget* pParentTarget,  
    BOOL bAutoDestroy = TRUE);

Parameters

pParentTarget
A pointer to the render target.

bAutoDestroy
Indicates that the object will be destroyed by owner (pParentTarget).

Creates a CD2DPathGeometry.

virtual HRESULT Create(CRenderTarget* pRenderTarget);

Parameters

pRenderTarget
A pointer to the render target.

Return Value

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Destroys a CD2DPathGeometry object.

virtual void Destroy();

Detaches resource interface from the object

ID2D1PathGeometry* Detach();

Return Value

Pointer to detached resource interface.

Retrieves tthe number of figures in the path geometry.

int GetFigureCount() const;  

Return Value

Returns the number of figures in the path geometry.

Retrieves the number of segments in the path geometry.

int GetSegmentCount() const;  

Return Value

Returns the number of segments in the path geometry.

A pointer to an ID2D1PathGeometry.

ID2D1PathGeometry* m_pPathGeometry;  

Retrieves the geometry sink that is used to populate the path geometry with figures and segments.

ID2D1GeometrySink* Open();

Return Value

A pointer to the ID2D1GeometrySink that is used to populate the path geometry with figures and segments.

Copies the contents of the path geometry to the specified ID2D1GeometrySink.

BOOL Stream(ID2D1GeometrySink* geometrySink);

Parameters

geometrySink
The sink to which the path geometry's contents are copied. Modifying this sink does not change the contents of this path geometry.

Return Value

If the method succeeds, it returns TRUE. Otherwise, it returns FALSE.

Classes

Show: