Class GradientStopCollection1
[Guid("ae1572f4-5dd0-4777-998b-9279472ae63b")]
public class GradientStopCollection1 : GradientStopCollection
- Inheritance
-
GradientStopCollection1
- Inherited Members
Constructors
GradientStopCollection1(DeviceContext, GradientStop[], ColorSpace, ColorSpace, BufferPrecision, ExtendMode, ColorInterpolationMode)
Initializes a new instance of the GradientStopCollection1 class.
public GradientStopCollection1(DeviceContext context, GradientStop[] straightAlphaGradientStops, ColorSpace preInterpolationSpace, ColorSpace postInterpolationSpace, BufferPrecision bufferPrecision, ExtendMode extendMode, ColorInterpolationMode colorInterpolationMode)
Parameters
context
DeviceContextThe context.
straightAlphaGradientStops
GradientStop[]An array of color values and offsets.
preInterpolationSpace
ColorSpaceSpecifies both the input color space and the space in which the color interpolation occurs.
postInterpolationSpace
ColorSpaceThe color space that colors will be converted to after interpolation occurs.
bufferPrecision
BufferPrecisionThe precision of the texture used to hold interpolated values.
extendMode
ExtendModeDefines how colors outside of the range defined by the stop collection are determined.
colorInterpolationMode
ColorInterpolationModeThe new gradient stop collection.
Remarks
This method linearly interpolates between the color stops. An optional color space conversion is applied after interpolation. Whether and how this gamma conversion is applied is determined before and after interpolation. This method will fail if the device context does not support the requested buffer precision.Additional ReferencesD2D1_GRADIENT_STOP, D2D1_GAMMA_CONVERSION, BufferPrecision, ExtendMode, GradientStopCollectionRequirementsMinimum supported operating systemSame as Interface / Class Highest IRQL levelN/A (user mode) Callable from DlllMain()No Callable from services and session 0Yes Callable from UI threadYes?
GradientStopCollection1(nint)
public GradientStopCollection1(nint nativePtr)
Parameters
nativePtr
nint
Properties
BufferPrecision
Gets the precision of the gradient buffer.
public BufferPrecision BufferPrecision { get; }
Property Value
Remarks
If this object was created using ID2D1RenderTarget::CreateGradientStopCollection, this method returns D2D1_BUFFER_PRECISION_8BPC_UNORM.
ColorInterpolationMode
Retrieves the color interpolation mode that the gradient stop collection uses.
public ColorInterpolationMode ColorInterpolationMode { get; }
Property Value
PostInterpolationSpace
Gets the color space after interpolation has occurred.
public ColorSpace PostInterpolationSpace { get; }
Property Value
Remarks
If you create using ID2D1RenderTarget::CreateGradientStopCollection, this method returns D2D1_COLOR_SPACE_SRGB.
PreInterpolationSpace
Gets the color space of the input colors as well as the space in which gradient stops are interpolated.
public ColorSpace PreInterpolationSpace { get; }
Property Value
Remarks
If this object was created using ID2D1RenderTarget::CreateGradientStopCollection, this method returns the color space related to the color interpolation gamma.
Methods
GetGradientStops1(GradientStop[], int)
Copies the gradient stops from the collection into memory.
public void GetGradientStops1(GradientStop[] gradientStops, int gradientStopsCount)
Parameters
gradientStops
GradientStop[]When this method returns, contains a reference to a one-dimensional array of GradientStop structures.
gradientStopsCount
intThe number of gradient stops to copy.
Remarks
If the GradientStopCollection1 object was created using ID2D1DeviceContext::CreateGradientStopCollection, this method returns the same values specified in the creation method. If the GradientStopCollection1 object was created using ID2D1RenderTarget::CreateGradientStopCollection, the stops returned here will first be transformed into the gamma space specified by the colorInterpolationGamma parameter. See the ID2D1DeviceContext::CreateGradientStopCollection method for more info about color space and gamma space.
If gradientStopsCount is less than the number of gradient stops in the collection, the remaining gradient stops are omitted. If gradientStopsCount is larger than the number of gradient stops in the collection, the extra gradient stops are set to null
. To obtain the number of gradient stops in the collection, use the GetGradientStopCount method.
Operators
explicit operator GradientStopCollection1(nint)
public static explicit operator GradientStopCollection1(nint nativePtr)
Parameters
nativePtr
nint