IPicture::SelectPicture method (ocidl.h)

Selects a bitmap picture into a given device context, and returns the device context in which the picture was previously selected as well as the picture's GDI handle. This method works in conjunction with IPicture::get_CurDC.

Syntax

HRESULT SelectPicture(
  [in]  HDC        hDCIn,
  [out] HDC        *phDCOut,
  [out] OLE_HANDLE *phBmpOut
);

Parameters

[in] hDCIn

A handle for the device context in which to select the picture.

[out] phDCOut

A pointer to a variable that receives the previous device context. This parameter can be NULL if the caller does not need this information. Ownership of the device context is always the responsibility of the caller.

[out] phBmpOut

A pointer to a variable that receives the GDI handle of the picture. This parameter can be NULL if the caller does not need the handle. Ownership of this handle is determined by the fOwn parameter passed to OleCreatePictureIndirect. Pictures loaded from a stream always own their resources.

Return value

This method supports the standard return values E_FAIL, E_INVALIDARG, E_OUTOFMEMORY, and S_OK.

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

IPicture::get_CurDC