Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IXpsOMGradientStop::SetColor method

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

Syntax


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

Parameters

color [in]

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.

colorProfile [in]

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 codeDescription
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

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps]

Header

Xpsobjectmodel.h

IDL

XpsObjectModel.idl

See also

IXpsOMGradientStop
XPS_COLOR
IXpsOMColorProfileResource
XPS Document Errors
XML Paper Specification

 

 

Show:
© 2017 Microsoft