IXpsOMObjectFactory::CreateSolidColorBrush 메서드(xpsobjectmodel.h)
단일 단색의 브러시를 지정하는 IXpsOMSolidColorBrush 인터페이스를 만듭니다.
구문
HRESULT CreateSolidColorBrush(
[in] const XPS_COLOR *color,
[in] IXpsOMColorProfileResource *colorProfile,
[out, retval] IXpsOMSolidColorBrush **solidColorBrush
);
매개 변수
[in] color
브러시 색을 지정하는 XPS_COLOR 구조체입니다.
[in] colorProfile
IXpsOMColorProfileResource 인터페이스입니다. 색 형식이 XPS_COLOR_TYPE_CONTEXT 않는 한 이 값은 NULL이어야 합니다.
[out, retval] solidColorBrush
새 IXpsOMSolidColorBrush 인터페이스에 대한 포인터입니다.
반환 값
이 메서드는 HRESULT를 반환합니다. 가능한 값에는 다음 표의 값이 포함되지만 이에 국한되지는 않습니다. 이 표에 나열되지 않은 XPS 문서 API 반환 값에 대한 자세한 내용은 XPS 문서 오류를 참조하세요.
반환 코드 | Description |
---|---|
|
메서드가 성공했습니다. |
|
color 또는 solidColorBrush 는 NULL입니다. |
|
colorProfile 은 색 프로필이 필요한 경우 NULL 입니다. 색 유형이 XPS_COLOR_TYPE_CONTEXT 경우 색 프로필이 필요합니다. |
|
colorProfile 은 인식된 인터페이스 구현을 가리키지 않습니다. XPS 문서 API 인터페이스의 사용자 지정 구현은 지원되지 않습니다. |
|
colorProfile 에는 색 프로필이 없을 때 색 프로필이 포함됩니다. 색 프로필은 색 유형이 XPS_COLOR_TYPE_CONTEXT 경우에만 필요합니다. |
설명
다음 코드 예제에서는 이 메서드를 사용하여 새 인터페이스를 만드는 방법을 보여 줍니다.
IXpsOMSolidColorBrush *newInterface;
// The following values are defined outside of
// this example.
// XPS_COLOR color;
// IXpsOMColorProfileResource *colorProfile;
// Note the implicit requirement that CoInitializeEx
// has previously been called from this thread.
hr = CoCreateInstance(
__uuidof(XpsOMObjectFactory),
NULL,
CLSCTX_INPROC_SERVER,
_uuidof(IXpsOMObjectFactory),
reinterpret_cast<LPVOID*>(&xpsFactory)
);
if (SUCCEEDED(hr))
{
hr = xpsFactory->CreateSolidColorBrush (
&color,
colorProfile,
&newInterface);
if (SUCCEEDED(hr))
{
// use newInterface
newInterface->Release();
}
xpsFactory->Release();
}
else
{
// evaluate HRESULT error returned in hr
}
요구 사항
요구 사항 | 값 |
---|---|
지원되는 최소 클라이언트 | Windows 7, Windows Vista SP2 및 Windows Vista용 플랫폼 업데이트 [데스크톱 앱 | UWP 앱] |
지원되는 최소 서버 | Windows Server 2008 R2, Windows Server 2008 SP2 및 Windows Server 2008용 플랫폼 업데이트 [데스크톱 앱 | UWP 앱] |
대상 플랫폼 | Windows |
헤더 | xpsobjectmodel.h |