다음을 통해 공유


COleClientItem::Draw

Call this function to draw the OLE item into the specified bounding rectangle using the specified device context.

BOOL Draw( 
   CDC* pDC, 
   LPCRECT lpBounds, 
   DVASPECT nDrawAspect = (DVASPECT 
)-1  
);

Parameters

  • pDC
    Pointer to a CDC object used for drawing the OLE item.

  • lpBounds
    Pointer to a CRect object or RECT structure that defines the bounding rectangle in which to draw the OLE item (in logical units determined by the device context).

  • nDrawAspect
    Specifies the aspect of the OLE item, that is, how it should be displayed. If nDrawAspect is –1, the last aspect set by using SetDrawAspect is used. For more information about possible values for this flag, see SetDrawAspect.

Return Value

Nonzero if successful; otherwise 0.

Remarks

The function may use the metafile representation of the OLE item created by the OnDraw member function of COleServerItem.

Typically you use Draw for screen display, passing the screen device context as pDC. In this case, you need to specify only the first two parameters.

The lpBounds parameter identifies the rectangle in the target device context (relative to its current mapping mode). Rendering may involve scaling the picture and can be used by container applications to impose a view that scales between the displayed view and the final printed image.

For more information, see IViewObject::Draw in the Windows SDK.

Requirements

Header: afxole.h

See Also

Reference

COleClientItem Class

Hierarchy Chart

COleClientItem::SetExtent

COleServerItem::OnDraw