Métodos ID2D1Geometry::CombineWithGeometry
Combina essa geometria com a geometria especificada e armazena o resultado em um ID2D1SimplifiedGeometrySink.
Lista de sobrecarga
Método | Descrição |
---|---|
CombineWithGeometry(ID2D1Geometry*,D2D1_COMBINE_MODE,D2D1_MATRIX_3X2_F,ID2D1SimplifiedGeometrySink&*) | Combina essa geometria com a geometria especificada e armazena o resultado em um ID2D1SimplifiedGeometrySink. |
CombineWithGeometry(ID2D1Geometry*,D2D1_COMBINE_MODE,D2D1_MATRIX_3X2_F*,ID2D1SimplifiedGeometrySink*) | Combina essa geometria com a geometria especificada e armazena o resultado em um ID2D1SimplifiedGeometrySink. |
CombineWithGeometry(ID2D1Geometry*,D2D1_COMBINE_MODE,D2D1_MATRIX_3X2_F,FLOAT,ID2D1SimplifiedGeometrySink&*) | Combina essa geometria com a geometria especificada e armazena o resultado em um ID2D1SimplifiedGeometrySink. |
CombineWithGeometry(ID2D1Geometry*,D2D1_COMBINE_MODE,D2D1_MATRIX_3X2_F*,FLOAT,ID2D1SimplifiedGeometrySink*) | Combina essa geometria com a geometria especificada e armazena o resultado em um ID2D1SimplifiedGeometrySink. |
Exemplos
O código a seguir usa cada um dos diferentes modos de combinação para combinar dois objetos ID2D1EllipseGeometry .
HRESULT DemoApp::CreateGeometryResources()
{
HRESULT hr = S_OK;
ID2D1GeometrySink *pGeometrySink = NULL;
// Create the first ellipse geometry to merge.
const D2D1_ELLIPSE circle1 = D2D1::Ellipse(
D2D1::Point2F(75.0f, 75.0f),
50.0f,
50.0f
);
hr = m_pD2DFactory->CreateEllipseGeometry(
circle1,
&m_pCircleGeometry1
);
if (SUCCEEDED(hr))
{
// Create the second ellipse geometry to merge.
const D2D1_ELLIPSE circle2 = D2D1::Ellipse(
D2D1::Point2F(125.0f, 75.0f),
50.0f,
50.0f
);
hr = m_pD2DFactory->CreateEllipseGeometry(circle2, &m_pCircleGeometry2);
}
if (SUCCEEDED(hr))
{
//
// Use D2D1_COMBINE_MODE_UNION to combine the geometries.
//
hr = m_pD2DFactory->CreatePathGeometry(&m_pPathGeometryUnion);
if (SUCCEEDED(hr))
{
hr = m_pPathGeometryUnion->Open(&pGeometrySink);
if (SUCCEEDED(hr))
{
hr = m_pCircleGeometry1->CombineWithGeometry(
m_pCircleGeometry2,
D2D1_COMBINE_MODE_UNION,
NULL,
NULL,
pGeometrySink
);
}
if (SUCCEEDED(hr))
{
hr = pGeometrySink->Close();
}
SafeRelease(&pGeometrySink);
}
}
if (SUCCEEDED(hr))
{
//
// Use D2D1_COMBINE_MODE_INTERSECT to combine the geometries.
//
hr = m_pD2DFactory->CreatePathGeometry(&m_pPathGeometryIntersect);
if (SUCCEEDED(hr))
{
hr = m_pPathGeometryIntersect->Open(&pGeometrySink);
if (SUCCEEDED(hr))
{
hr = m_pCircleGeometry1->CombineWithGeometry(
m_pCircleGeometry2,
D2D1_COMBINE_MODE_INTERSECT,
NULL,
NULL,
pGeometrySink
);
}
if (SUCCEEDED(hr))
{
hr = pGeometrySink->Close();
}
SafeRelease(&pGeometrySink);
}
}
if (SUCCEEDED(hr))
{
//
// Use D2D1_COMBINE_MODE_XOR to combine the geometries.
//
hr = m_pD2DFactory->CreatePathGeometry(&m_pPathGeometryXOR);
if (SUCCEEDED(hr))
{
hr = m_pPathGeometryXOR->Open(&pGeometrySink);
if (SUCCEEDED(hr))
{
hr = m_pCircleGeometry1->CombineWithGeometry(
m_pCircleGeometry2,
D2D1_COMBINE_MODE_XOR,
NULL,
NULL,
pGeometrySink
);
}
if (SUCCEEDED(hr))
{
hr = pGeometrySink->Close();
}
SafeRelease(&pGeometrySink);
}
}
if (SUCCEEDED(hr))
{
//
// Use D2D1_COMBINE_MODE_EXCLUDE to combine the geometries.
//
hr = m_pD2DFactory->CreatePathGeometry(&m_pPathGeometryExclude);
if (SUCCEEDED(hr))
{
hr = m_pPathGeometryExclude->Open(&pGeometrySink);
if (SUCCEEDED(hr))
{
hr = m_pCircleGeometry1->CombineWithGeometry(
m_pCircleGeometry2,
D2D1_COMBINE_MODE_EXCLUDE,
NULL,
NULL,
pGeometrySink
);
}
if (SUCCEEDED(hr))
{
hr = pGeometrySink->Close();
}
SafeRelease(&pGeometrySink);
}
}
return hr;
}
Esse código produz a saída mostrada na ilustração a seguir.
Requisitos
Requisito | Valor |
---|---|
Biblioteca |
|
DLL |
|