[OLEAUT32] Multiple fixes to OLEPicture implementation

a_villacis at palosanto.com a_villacis at palosanto.com
Wed May 26 10:43:46 CDT 2004


It seems that the best way to shake bugs in OLE Automation in
Wine is to try to exercise it with Visual Basic 6. The 
following problems were found when trying to run VB6 with Wine,
all of them involving OLEPicture:

* Icon rendering fails when contained within an OLEPicture. The
  root cause is that the PIXEL --> HIMETRIC transformation
  applied to bitmaps is not applied to icons too - the pixel
  dimensions are reported as-is into the HIMETRIC properties.
* Some BMPs are misidentified as icons in OLEPictureImpl_Load().
  The root cause is that the IStream header validation is not
  strict enough, and marks as valid IStream headers some BMP 
  headers.
* GIF loading code fails to account for interlaced images.
* GIF loading code fails to pad scanlines at DWORD boundaries.
* Palette-based BMPs (colordepth 8 or less) were horribly 
  displayed. Root cause: misuse of DIB_PAL_COLORS at 
  the creation of the HBITMAP - it means not that image is 
  palette-based on the stream, but rather that palette 
  indexes are actually indexes into the currently realized
  palette in the target DC.
* All of the save features of OLEPicture were unimplemented
  and reported failure under VB6. This lead to a series of
  \"System error xxxxx\" when a form containing a picture was
  dismissed.

Changelog (against 20040505 tarball):
* Apply HIMETRIC transformation on icon dimensions as well as
  bitmaps.
* Made IStream header validation more strict - known image 
  headers (BMP, GIF, JPEG) are now checked for and the header
  is considered not an IStream header if any of them is found.
* Loadtime IStream header is remebered, in order to restore it 
  on save.
* Added interlaced support for GIFs
* Added DWORD padding for GIFs.
* HBITMAP creation when loading BMPs now always uses
  DIB_RGB_COLORS, even on palette based images.
* Added bIsDirty flag to OLEPicture. This flag is set to FALSE
  on constructor and Load, and is set to TRUE on the 
  PictureChanged method (which is presumably to inform the
  OLEPicture that the bitmap just changed). 
* Added save support to OLEPicture. The save support honors 
  the bIsDirty flag and just saves the image buffer if this
  flag is set to FALSE. If the flag is set to TRUE, a number
  of serialization methods are provided (ICON, GIF, BMP, 
  JPEG still unimplemented :-( ). 
  However, when the Windows application is run on an X set at
  PseudoColor visual, the GIF serialization mangles the palette
  because of some as-yet unidentified bug in palette reporting 
  in GetDIBits(). Probably the palette corruption also affects
  BMP images when the app is run in an X display at 
  PseudoColor visual (8bpp).

My next goal is to check the problems on the palette support 
in Wine on PseudoColor visual. Any help would be appreciated.

Alex Villacís Lasso


------------------------------------------------------------------------
Mail enviado desde PortalMail 1.4.2 Web based email system.
PaloSanto Solutions, Sunnyvale CA.
http://www.palosanto.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine-patch-OLEPictureImpl_Load_Save.diff
Type: application/octet-stream
Size: 31826 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20040526/e9697b93/wine-patch-OLEPictureImpl_Load_Save.obj


More information about the wine-patches mailing list