Share via


IVsGradient.GetGradientVector Method

Returns an array of colors used to create a brush for a given gradient.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

Syntax

'Declaration
Function GetGradientVector ( _
    cVector As Integer, _
    <OutAttribute> rgVector As UInteger() _
) As Integer
int GetGradientVector(
    int cVector,
    uint[] rgVector
)
int GetGradientVector(
    [InAttribute] int cVector, 
    [OutAttribute] array<unsigned int>^ rgVector
)
abstract GetGradientVector : 
        cVector:int * 
        rgVector:uint32[] byref -> int
function GetGradientVector(
    cVector : int, 
    rgVector : uint[]
) : int

Parameters

  • cVector
    Type: System.Int32

    [in] Size of the rgVector array to be returned.

  • rgVector
    Type: array<System.UInt32[]

    [out] An array of cVector RGB values that define a gradient.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell80.idl:

HRESULT IVsGradient::GetGradientVector(
   [in] int cVector,
   [in,out, size_is(cVector)] COLORREF* rgVector
);

When using this method, the specified value of cVector should be the number of pixels to be painted in the direction of the gradient on to a UI element.

Each of the RGB values in the rgVector array are 32-bit Windows color values in the format of a COLOREF.

C++ code can make direct use of the returned RGB value by using the macros that support COLOREFs, such as GetRValue, GetGValue and GetBValue.

Managed code that uses returned colors can use a System.Drawing.Color structure, which can be obtained from the 32-bit Windows color value by using System.Drawing.ColorTranslator.FromWin32.

.NET Framework Security

See Also

Reference

IVsGradient Interface

Microsoft.VisualStudio.Shell.Interop Namespace