IXpsOMGradientStop::SetColor method (xpsobjectmodel.h)

Sets the color value and color profile of the gradient stop.

Syntax

HRESULT SetColor(
  [in] const XPS_COLOR            *color,
  [in] IXpsOMColorProfileResource *colorProfile
);

Parameters

[in] color

The color value to be set at the gradient stop.

If the value of the colorType field in the XPS_COLOR structure that is passed in this parameter is XPS_COLOR_TYPE_CONTEXT, a valid color profile must be provided in the colorProfile parameter.

[in] colorProfile

The color profile to be used with color.

A color profile is required when the value of the colorType field in the XPS_COLOR structure that is passed in the color parameter is XPS_COLOR_TYPE_CONTEXT. If the value of the colorType field is not XPS_COLOR_TYPE_CONTEXT, this parameter must be set to NULL.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the table that follows. For information about XPS document API return values that are not listed in this table, see XPS Document Errors.

Return code Description
S_OK
The method succeeded.
E_POINTER
color is NULL.
XPS_E_MISSING_COLORPROFILE
colorProfile is NULL when a color profile was expected. A color profile is required when the color type is XPS_COLOR_TYPE_CONTEXT.
XPS_E_NO_CUSTOM_OBJECTS
colorProfile does not point to a recognized interface implementation. Custom implementation of XPS Document API interfaces is not supported.
XPS_E_UNEXPECTED_COLORPROFILE
colorProfile contained a color profile when one was not expected. A color profile is only allowed when the color type is XPS_COLOR_TYPE_CONTEXT.

Remarks

A color profile is only required when the color type of color is XPS_COLOR_TYPE_CONTEXT.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header xpsobjectmodel.h

See also

IXpsOMColorProfileResource

IXpsOMGradientStop

XML Paper Specification

XPS Document Errors

XPS_COLOR