PRB: Saving/Loading Bitmaps in .DIB Format on MIPSLast reviewed: November 2, 1995Article ID: Q85844 |
The information in this article applies to:
SYMPTOMSIn Win32, saving or loading a bitmap in .DIB file format is basically the same as in Win16. However, care must be taken in DWORD alignment, especially on the MIPS platform. An exception occurs when loading or saving a bitmap on the MIPS platform. In NTSD, the following error message is received:
data mis-alignment CAUSEA non-DWORD aligned actual parameter was passed to a function such as GetDIBits(). The .DIB file format contains the BITMAPFILEHEADER followed immediately by the BITMAPINFOHEADER. Notice that the BITMAPFILEHEADER is not DWORD aligned. Thus, the structure that follows it, the BITMAPINFOHEADER, is not on a DWORD boundary. If a pointer to this DWORD misaligned structure is passed to the sixth argument of GetDIBits(), an exception will occur.
RESOLUTIONTo resolve this problem, copy the data in the structure over to a DWORD- aligned memory and pass the pointer to the latter structure to the function instead. See the sample code LOADBMP.C for detail.
MORE INFORMATIONThe is a sample to illustrates this process. Refer to the LOADBMP.C file in the MANDEL sample that comes with the Win32 SDK.
|
Additional reference words: 3.10 3.50
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |