Commit 1e0ab160 authored by Alexandre Julliard's avatar Alexandre Julliard

oleaut32: Fix IPicture::SelectPicture to not try to select a bitmap into two DCs at the same time.

parent 430c8aa9
......@@ -141,6 +141,7 @@ typedef struct OLEPictureImpl {
BOOL keepOrigFormat;
HDC hDCCur;
HBITMAP stock_bitmap;
/* Bitmap transparency mask */
HBITMAP hbmMask;
......@@ -219,6 +220,7 @@ static void OLEPictureImpl_SetBitmap(OLEPictureImpl *This)
This->himetricWidth = xpixels_to_himetric(bm.bmWidth, hdcRef);
This->himetricHeight = ypixels_to_himetric(bm.bmHeight, hdcRef);
This->stock_bitmap = GetCurrentObject( hdcRef, OBJ_BITMAP );
DeleteDC(hdcRef);
}
......@@ -769,10 +771,10 @@ static HRESULT WINAPI OLEPictureImpl_SelectPicture(IPicture *iface,
OLEPictureImpl *This = impl_from_IPicture(iface);
TRACE("(%p)->(%p, %p, %p)\n", This, hdcIn, phdcOut, phbmpOut);
if (This->desc.picType == PICTYPE_BITMAP) {
SelectObject(hdcIn,This->desc.u.bmp.hbitmap);
if (phdcOut)
*phdcOut = This->hDCCur;
if (This->hDCCur) SelectObject(This->hDCCur,This->stock_bitmap);
if (hdcIn) SelectObject(hdcIn,This->desc.u.bmp.hbitmap);
This->hDCCur = hdcIn;
if (phbmpOut)
*phbmpOut = HandleToUlong(This->desc.u.bmp.hbitmap);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment