IPicture::Render

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.

HRESULT Render(
  HDC hdc, //Handle of device context on which to render the image
  long x,  //Horizontal position of image in hdc
  long y,  //Vertical position of image in hdc
  long cx, //Horizontal dimension of destination rectangle
  long cy, //Vertical dimension of destination rectangle
  OLE_XPOS_HIMETRIC xSrc,
           //Horizontal offset in source picture
  OLE_YPOS_HIMETRIC ySrc,
           //Vertical offset in source picture
  OLE_XSIZE_HIMETRIC cxSrc,
           //Amount to copy horizontally in source picture
  OLE_YSIZE_HIMETRIC cySrc,
           //Amount to copy vertically in source picture
  LPCRECT prcWBounds
           //Pointer to position of destination for a metafile hdc
);
 

Parameters

hdc
[in] Handle of the device context on which to render the image.
x
[in] Horizontal coordinate in hdc at which to place the rendered image.
y
[in] Vertical coordinate in hdc at which to place the rendered image.
cx
[in] Horizontal dimension of the destination rectangle.
cy
[in] Vertical dimension of the destination rectangle.
xSrc
[in] Horizontal offset in the source picture from which to start copying.
ySrc
[in] Vertical offset in the source picture from which to start copying.
cxSrc
[in] Horizontal extent to copy from the source picture.
cySrc
[in] Vertical extent to copy from the source picture.
prcWBounds
[in] 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 Values

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

S_OK
The picture was rendered successfully.
E_POINTER
The address in prcWBounds is not valid when hdc contains a metafile device context.

QuickInfo

  Windows NT: Use version 4.0 or later.
  Windows: Use Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in ocidl.h.