SetGradient method

Sets the parameters used to produce the gradient surface.


HRESULT retVal = object.SetGradient(StartColor, EndColor, bHorizontal);


  • StartColor
    Type: DXSAMPLE

    Start color in DXSAMPLE format.

  • EndColor
    Type: DXSAMPLE

    End color in DXSAMPLE format.

  • bHorizontal
    Type: BOOL

    BOOL value that indicates the gradient direction. If TRUE, the gradient is horizontal; if FALSE, the gradient is vertical.


The start color is on the left side of the image for horizontal gradients and on the top of the image for vertical gradients.