IXpsRasterizationFactory2::CreateRasterizer method (xpsrassvc.h)

The CreateRasterizer method creates an XPS rasterizer object that can convert content from XPS to PWG Raster using the XPS Rasterization Service. PWG Raster supports non-square DPIs.

Syntax

HRESULT CreateRasterizer(
  [in, optional]  IXpsOMPage              *xpsPage,
  [in]            FLOAT                   DPIX,
  [in]            FLOAT                   DPIY,
  [in]            XPSRAS_RENDERING_MODE   nonTextRenderingMode,
  [in]            XPSRAS_RENDERING_MODE   textRenderingMode,
  [in]            XPSRAS_PIXEL_FORMAT     pixelFormat,
  [in]            XPSRAS_BACKGROUND_COLOR backgroundColor,
  [out, optional] IXpsRasterizer          **ppIXpsRasterizer
);

Parameters

[in, optional] xpsPage

Pointer to an IXpsOMPage object that represents the XPS fixed page to render. This object encapsulates a FixedPage section from an XPS document.

[in] DPIX

Dots per inch which is applied to x dimension of the rasterized output bitmap. The DPI value is the resolution of the device that is to print or display the XPS fixed page.

[in] DPIY

Dots per inch which is applied to y dimension of the rasterized output bitmap.

[in] nonTextRenderingMode

Rendering mode for nontext items in the rasterized output. This parameter indicates whether to generate antialiased output. Set this parameter to one of the following XPSRAS_RENDERING_MODE enumeration values:

  • XPSRAS_RENDERING_MODE_ANTIALIASED

  • XPSRAS_RENDERING_MODE_ALIASED

[in] textRenderingMode

Rendering mode for text in the rasterized output. This parameter indicates whether to generate antialiased output. Set this parameter to one of the following XPSRAS_RENDERING_MODE enumeration values:

  • XPSRAS_RENDERING_MODE_ANTIALIASED

  • XPSRAS_RENDERING_MODE_ALIASED

[in] pixelFormat

Allows a caller to select the pixel format used by the IWICBitmap returned by IXpsRasterizer::RasterizeRect. Set this parameter to one of the following XPSRAS_PIXEL_FORMAT enumeration values:

  • XPSRAS_PIXEL_FORMAT_32BPP_PBGRA_UINT_SRGB

  • XPSRAS_PIXEL_FORMAT_64BPP_PRGBA_HALF_SCRGB

  • XPSRAS_PIXEL_FORMAT_128BPP_PRGBA_FLOAT_SCRGB

[in] backgroundColor

Allows a caller to select background color. Set this parameter to one of the following XPSRAS_BACKGROUND_COLOR enumeration values:

  • XPSRAS_BACKGROUND_COLOR_TRANSPARENT

  • XPSRAS_BACKGROUND_COLOR_OPAQUE

  • The default background color is XPSRAS_BACKGROUND_COLOR_TRANSPARENT.

[out, optional] ppIXpsRasterizer

This parameter points to a location into which the method writes a pointer to the IXpsRasterizer interface of the newly created XPS rasterizer object. If the method fails, it writes NULL to this location and returns an error code.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Requirement Value
Minimum supported client Windows 10
Target Platform Desktop
Header xpsrassvc.h (include Xpsrassvc.h)

See also

IXpsRasterizationFactory2