IPicture::Render method (ocidl.h)

Renders (draws) a specified portion of the picture defined by the offset (xSrc,ySrc) of the source picture and the dimensions to copy (cxSrc,xySrc). This picture is rendered onto the specified device context, positioned at the point (x,y), and scaled to the dimensions (cx,cy). The prcWBounds parameter specifies the position of this rendering if the destination device context is itself a metafile. Such information is necessary to place one metafile in another. For more information, see the prcWBounds parameter of IViewObject2::Draw.

Syntax

HRESULT Render(
  [in] HDC                hDC,
  [in] LONG               x,
  [in] LONG               y,
  [in] LONG               cx,
  [in] LONG               cy,
  [in] OLE_XPOS_HIMETRIC  xSrc,
  [in] OLE_YPOS_HIMETRIC  ySrc,
  [in] OLE_XSIZE_HIMETRIC cxSrc,
  [in] OLE_YSIZE_HIMETRIC cySrc,
  [in] LPCRECT            pRcWBounds
);

Parameters

[in] hDC

A handle of the device context on which to render the image.

[in] x

The horizontal coordinate in hdc at which to place the rendered image.

[in] y

The vertical coordinate in hdc at which to place the rendered image.

[in] cx

The horizontal dimension (width) of the destination rectangle.

[in] cy

The vertical dimension (height) of the destination rectangle

[in] xSrc

The horizontal offset in the source picture from which to start copying.

[in] ySrc

The vertical offset in the source picture from which to start copying.

[in] cxSrc

The horizontal extent to copy from the source picture.

[in] cySrc

The vertical extent to copy from the source picture.

[in] pRcWBounds

A pointer to a rectangle containing the position of the destination within a metafile device context if hdc is a metafile DC. Cannot be NULL in such cases.

Return value

This method supports the standard return values E_FAIL, E_INVALIDARG, and E_OUTOFMEMORY, as well as the following:

Return code Description
S_OK
The picture was rendered successfully.
E_POINTER
The address in prcWBounds is not valid when hdc contains a metafile device context.
CTL_E_INVALIDPROPERTYVALUE
The parameter cx, cy, cxSrc, or cySrc has a value of zero.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ocidl.h

See also

IPicture