Creates a set of clockwise-wound triangles that cover the geometry after it has been transformed using the specified matrix and flattened using the specified tolerance.
Overload List
Examples
The following code example shows how to use Tessellate to create a set of clockwise-wound triangles that cover the geometry.
ID2D1GeometrySink *pGeometrySink = NULL;
hr = pPathGeometry->Open(&pGeometrySink);
if (SUCCEEDED(hr))
{
hr = pGeometry->Widen(
strokeWidth,
pIStrokeStyle,
pWorldTransform,
pGeometrySink
);
if (SUCCEEDED(hr))
{
hr = pGeometrySink->Close();
if (SUCCEEDED(hr))
{
ID2D1Mesh *pMesh = NULL;
hr = m_pRT->CreateMesh(&pMesh);
if (SUCCEEDED(hr))
{
ID2D1TessellationSink *pSink = NULL;
hr = pMesh->Open(&pSink);
if (SUCCEEDED(hr))
{
hr = pPathGeometry->Tessellate(
NULL, // world transform (already handled in Widen)
pSink
);
if (SUCCEEDED(hr))
{
hr = pSink->Close();
if (SUCCEEDED(hr))
{
SafeReplace(&m_pStrokeMesh, pMesh);
}
}
pSink->Release();
}
pMesh->Release();
}
}
}
pGeometrySink->Release();
}
pPathGeometry->Release();
For the complete example, see the Geometry Realization Sample.
Requirements
| Library | D2d1.lib |
| DLL | D2d1.dll |
See Also
- ID2D1Geometry
Send comments about this topic to Microsoft
Build date: 11/15/2009