IXRGradientStop::GetOffset (Compact 2013)

3/28/2014

This method retrieves the location of this gradient stop within the gradient vector.

Syntax

virtual HRESULT STDMETHODCALLTYPE GetOffset(
    float* pOffset
) = 0;

Parameters

  • pOffset
    [out] Pointer to a float value that indicates the relative location of this gradient stop along the gradient vector.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

The mapping-mode value, which is obtained by using the inherited method IXRGradientBrush::GetMappingMode, does not influence how the offset values are interpreted. Regardless of mapping mode, the offset is always interpreted as a factor between 0 and 1 along the vector that defines the gradient.

A pOffset value of 0 specifies that the gradient stop is positioned at the beginning of the gradient vector, while a value of 1 specifies that the gradient stop is positioned at the end of the gradient vector.

The gradient-stop offset factor and the way the brush specifies its vector determine the resulting gradient pattern. A linear gradient-brush vector follows a line that runs from its StartPoint to its EndPoint. A radial gradient-brush vector radiates from its GradientOrigin toward the ellipse that is formed by Center, RadiusX, and RadiusY.

pOffset values slightly greater than 1 or slightly less than 0 are valid and will influence the gradient pattern. However, the same gradient pattern could probably be achieved by using values between 0 and 1, if all the gradient stops are adjusted relative to one another.

.NET Framework Equivalent

System.Windows.Media.GradientStop.Offset

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRGradientStop
IXRGradientStop::SetOffset