ID2D1RenderTarget :: CreateGradientStopCollection, méthodes

Crée un ID2D1GradientStopCollection à partir du tableau spécifié de structures de _ _ point de dégradé d2d1 .

Liste de surcharge

Méthode Description
CreateGradientStopCollection (D2D1 _ _ Stop * , D2D1 _ gamma, d2d1 _ mode Extend _ , ID2D1GradientStopCollection * * ) Crée un ID2D1GradientStopCollection à partir des points de dégradé, du gamma d’interpolation de couleur et du mode extension spécifiés.
CreateGradientStopCollection (D2D1 _ point _ * de dégradé, ID2D1GradientStopCollection * * ) Crée un ID2D1GradientStopCollection à partir des points de dégradé spécifiés qui utilisent la gamma de l’interpolation de couleur d2d1 _ gamma _ 2 _ 2 et le mode d’extension de la bride.

Exemples

L’exemple suivant crée un tableau de points de dégradé, puis les utilise pour créer un 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
    );

L’exemple de code suivant utilise ID2D1GradientStopCollection pour créer un 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
        );
}

Spécifications

Condition requise Valeur
En-tête
D2d1 _ 1. h (inclure D2d1. h)
Bibliothèque
D2d1. lib
DLL
D2d1.dll

Voir aussi

ID2D1RenderTarget

_Point de dégradé d2d1 _

Comment créer un pinceau de dégradé linéaire

Comment créer un pinceau de dégradé radial

Vue d’ensemble des pinceaux