ID2D1Geometry::Tessellate Overloaded Method

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

NameDescription

Tessellate(D2D1_MATRIX_3X2_F*,ID2D1TessellationSink*)

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.

Tessellate(D2D1_MATRIX_3X2_F*,FLOAT,ID2D1TessellationSink*)

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.

Tessellate(D2D1_MATRIX_3X2_F&,ID2D1TessellationSink*)

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.

Tessellate(D2D1_MATRIX_3X2_F&,FLOAT,ID2D1TessellationSink*)

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.

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

LibraryD2d1.lib
DLLD2d1.dll

See Also

ID2D1Geometry

Send comments about this topic to Microsoft

Build date: 11/15/2009

Tags :


Page view tracker