지정된 D2D1_GRADIENT_STOP 구조체 배열에서 ID2D1GradientStopCollection을 만듭니다.
오버로드 목록
| 메서드 | Description |
|---|---|
| CreateGradientStopCollection(D2D1_GRADIENT_STOP*,D2D1_GAMMA,D2D1_EXTEND_MODE,ID2D1GradientStopCollection**) | 지정된 그라데이션 중지점, 색 보간 감마 및 확장 모드에서 ID2D1GradientStopCollection 을 만듭니다. |
| CreateGradientStopCollection(D2D1_GRADIENT_STOP*,ID2D1GradientStopCollection**) |
D2D1_GAMMA_2_2 색 보간 감마 및 클램프 확장 모드를 사용하는 지정된 그라데이션 중지점에서 ID2D1GradientStopCollection을 만듭니다. |
예제
다음 예제에서는 그라데이션 중지점 배열을 만든 다음, 이를 사용하여 ID2D1GradientStopCollection을 만듭니다.
// Create an array of gradient stops to put in the gradient stop
// collection that will be used in the gradient brush.
ID2D1GradientStopCollection *pGradientStops = NULL;
D2D1_GRADIENT_STOP gradientStops[2];
gradientStops[0].color = D2D1::ColorF(D2D1::ColorF::Yellow, 1);
gradientStops[0].position = 0.0f;
gradientStops[1].color = D2D1::ColorF(D2D1::ColorF::ForestGreen, 1);
gradientStops[1].position = 1.0f;
// Create the ID2D1GradientStopCollection from a previously
// declared array of D2D1_GRADIENT_STOP structs.
hr = m_pRenderTarget->CreateGradientStopCollection(
gradientStops,
2,
D2D1_GAMMA_2_2,
D2D1_EXTEND_MODE_CLAMP,
&pGradientStops
);
다음 코드 예제에서는 ID2D1GradientStopCollection 을 사용하여 ID2D1LinearGradientBrush를 만듭니다.
// The line that determines the direction of the gradient starts at
// the upper-left corner of the square and ends at the lower-right corner.
if (SUCCEEDED(hr))
{
hr = m_pRenderTarget->CreateLinearGradientBrush(
D2D1::LinearGradientBrushProperties(
D2D1::Point2F(0, 0),
D2D1::Point2F(150, 150)),
pGradientStops,
&m_pLinearGradientBrush
);
}
요구 사항
| 요구 사항 | 값 |
|---|---|
| 헤더 |
|
| 라이브러리 |
|
| DLL |
|