次の方法で共有


IXRRadialGradientBrush::GetGradientOrigin (Compact 2013)

3/28/2014

This method retrieves the location of the focal point where the radial gradient begins.

Syntax

virtual HRESULT STDMETHODCALLTYPE GetGradientOrigin(
    XRPoint* pGradientOrigin
) = 0;

Parameters

  • pGradientOrigin
    [out] Pointer to an XRPoint structure that defines the two-dimensional location that is the beginning of the radial gradient pattern.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

When the inherited method IXRGradientBrush::GetMappingMode indicates that the mapping mode is set to XRBrushMappingMode_RelativeToBoundingBox, Center and GradientOrigin "logical points." Logical points have values between 0 and 1 and are mapped against the total size of the resulting bounding box where this brush is applied. A point value of 0.5 sets the center and gradient origin to the logical center of the bounding box.

If the mapping mode is set to XRBrushMappingMode_Absolute, GradientOrigin (that is, the value in pGradientOrigin) should be supplied as a true point value in the coordinate system.

When the Center and the GradientOrigin are at the same point, they can create the illusion of a specular highlight from a direct lighting source. By contrast, when they are not at the same point, they can create the illusion of a specular highlight from an "off-center" lighting source. This technique is very useful for creating three-dimensional effects from two-dimensional objects.

.NET Framework Equivalent

System.Windows.Media.RadialGradientBrush.GradientOrigin

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRRadialGradientBrush
IXRRadialGradientBrush::SetGradientOrigin