# IPicture::SelectPicture

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.

HRESULT SelectPicture(

HDC hdcIn , | //New device context
HDC* phdcOut , | //Receives a pointer to the previous device context
OLE_HANDLE* phbmpOut | //Receives a pointer to GDI handle of the picture
); |

Parameters

hdcIn
  [in] Device context in which to select the picture.
phdcOut
  [out] Pointer to the caller’s HDC variable to receive 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.
phbmpOut
  [out] Pointer to the caller’s HDC variable to receive 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 Values

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

S_OK
  The picture was selected successfully.

See Also

IPicture::get_CurDC