oleaut32: OleCreatePictureIndirect should set loadtime_format for a bitmap.

This commit is contained in:
Dmitry Timoshkov 2012-05-17 18:30:07 +09:00 committed by Alexandre Julliard
parent 48df41f834
commit 25fd436db0
1 changed files with 10 additions and 11 deletions

View File

@ -68,6 +68,12 @@
WINE_DEFAULT_DEBUG_CHANNEL(olepicture); WINE_DEFAULT_DEBUG_CHANNEL(olepicture);
#define BITMAP_FORMAT_BMP 0x4d42 /* "BM" */
#define BITMAP_FORMAT_JPEG 0xd8ff
#define BITMAP_FORMAT_GIF 0x4947
#define BITMAP_FORMAT_PNG 0x5089
#define BITMAP_FORMAT_APM 0xcdd7
#include "pshpack1.h" #include "pshpack1.h"
/* Header for Aldus Placable Metafiles - a standard metafile follows */ /* Header for Aldus Placable Metafiles - a standard metafile follows */
@ -212,6 +218,8 @@ static void OLEPictureImpl_SetBitmap(OLEPictureImpl *This)
This->origWidth = bm.bmWidth; This->origWidth = bm.bmWidth;
This->origHeight = bm.bmHeight; This->origHeight = bm.bmHeight;
TRACE("width %d, height %d, bpp %d\n", bm.bmWidth, bm.bmHeight, bm.bmBitsPixel);
/* The width and height are stored in HIMETRIC units (0.01 mm), /* The width and height are stored in HIMETRIC units (0.01 mm),
so we take our pixel width divide by pixels per inch and so we take our pixel width divide by pixels per inch and
multiply by 25.4 * 100 */ multiply by 25.4 * 100 */
@ -222,6 +230,8 @@ static void OLEPictureImpl_SetBitmap(OLEPictureImpl *This)
This->himetricHeight = ypixels_to_himetric(bm.bmHeight, hdcRef); This->himetricHeight = ypixels_to_himetric(bm.bmHeight, hdcRef);
This->stock_bitmap = GetCurrentObject( hdcRef, OBJ_BITMAP ); This->stock_bitmap = GetCurrentObject( hdcRef, OBJ_BITMAP );
This->loadtime_format = BITMAP_FORMAT_BMP;
DeleteDC(hdcRef); DeleteDC(hdcRef);
} }
@ -1321,17 +1331,6 @@ static HRESULT OLEPictureImpl_LoadAPM(OLEPictureImpl *This,
return S_OK; return S_OK;
} }
/************************************************************************
* BITMAP FORMAT FLAGS -
* Flags that differentiate between different types of bitmaps.
*/
#define BITMAP_FORMAT_BMP 0x4d42 /* "BM" */
#define BITMAP_FORMAT_JPEG 0xd8ff
#define BITMAP_FORMAT_GIF 0x4947
#define BITMAP_FORMAT_PNG 0x5089
#define BITMAP_FORMAT_APM 0xcdd7
/************************************************************************ /************************************************************************
* OLEPictureImpl_IPersistStream_Load (IUnknown) * OLEPictureImpl_IPersistStream_Load (IUnknown)
* *