Microsoft KB Archive/216205

= PRB: "Error 481: Invalid Picture" Error Viewing BMP File =

Article ID: 216205

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Basic 4.0 Standard Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 32-Bit Enterprise Edition

-



This article was previously published under Q216205



SYMPTOMS
Bitmaps created using Win98 Imaging components, such as Imaging for Windows (Win98) or IMGEDIT.OCX, create a BMP that cannot be read in Windows 95, Windows NT 4.0, or Windows 2000 using MSPAINT.EXE or the Visual Basic PictureBox control.

You would receive the folling error message:

Error 481: Invalid Picture When Viewing BMP Created Using Kodak Imaging in Win98



CAUSE
The Win98 Imaging components save out the bitmaps using the v5.0 BITMAPINFOHEADER structure.

Following is the VC++ BITMAPINFOHEADER v5.0 structure:

typedef struct { DWORD       bV5Size; LONG        bV5Width; LONG        bV5Height; WORD        bV5Planes; WORD        bV5BitCount; DWORD       bV5Compression; DWORD       bV5SizeImage; LONG        bV5XPelsPerMeter; LONG        bV5YPelsPerMeter; DWORD       bV5ClrUsed; DWORD       bV5ClrImportant; DWORD       bV5RedMask; DWORD       bV5GreenMask; DWORD       bV5BlueMask; DWORD       bV5AlphaMask; DWORD       bV5CSType; CIEXYZTRIPLE bV5Endpoints; DWORD       bV5GammaRed; DWORD       bV5GammaGreen; DWORD       bV5GammaBlue; DWORD       bV5Intent; DWORD       bV5ProfileData; DWORD       bV5ProfileSize; DWORD       bV5Reserved; } BITMAPV5HEADER, FAR *LPBITMAPV5HEADER, *PBITMAPV5HEADER;

The members of this structure, starting with bV5Size through bV5ClrImportant, are the same as those found in a normal BITMAPINFOHEADER structure, which is readable in Windows 95, Windows NT, and Windows 2000. The remainder of the BITMAPINFOHEADER structure contains new members where older applications would expect to find the start of the Color Table.



RESOLUTION
There are three workarounds for this problem:


 * Open the resultant BMP using the 'Imaging for Windows' application on either Windows 95, Windows NT, or Windows 2000, and save it again. This saves the bitmap in the standard BMP format.


 * Open the resultant BMP using the IMGEDIT control in Windows 95, Windows NT, or Windows 2000 and do a SaveAs on the image to again save it out as a BMP. This saves the bitmap in the standard BMP format.


 * Create a routine that reads the BMP file and converts it back to the original BITMAPINFOHEADER structure.



STATUS
This problem has been reported as a bug to Eastman Kodak, makers of the Imaging controls.



Steps to Reproduce Behavior

 * 1) Using the Win98 ImgEdit control, save a BMP image to a file.
 * 2) Take that file to a Windows 95, Windows NT, or Windows 2000 system. Attempt to load it into either MSPAINT.EXE or the Picture Property of a Visual Basic PictureBox control.

Keywords: kbbitmap kbprb kb3rdparty KB216205

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.