The information in this article applies to:
SUMMARY
SeedIB.exe is a sample application that demonstrates how to load, display,
and save 1, 4, 8, 16, 24, and 32-bits-per-pixel (Device Independent Bitmap (DIB) formats. In addition, SeedIB.exe demonstrates a simple method of creating an optimized palette for displaying DIBs with more than 8-bits-per-pixel on 8-bits-per-pixel devices.
MORE INFORMATIONThe following file is available for download from the Microsoft
Download Center. Click the file name below to download the file: SeedIB.exeFor more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address http://www.microsoft.com/downloads/search.aspand then click How to use the Microsoft Download Center. For DIBs, the 16 and 32-bit formats contain three DWORD masks in the bmiColors member of the BITMAPINFO structure. These masks specify which bits in the pel correspond to which color. The three masks must have contiguous bits, and their order is assumed to be R, G, B (high bits to low bits). The order of the three masks in the color table must also be first red, then green, then blue (RGB). In this manner, the programmer can specify a mask indicating how many shades of each RGB color will be available for bitmaps created with CreateDIBitmap(). For 16-bits-per-pixel DIBs, CreateDIBitmap() defaults to the RGB555 format. For 32-bits-per-pixel DIBs, CreateDIBitmap() defaults to an RGB888 format. NOTE: The DIB engine in Windows 95 supports only RGB555 and RGB565 for 16-bit DIBs and only RGB888 for 32-bit DIBs. ExampleThe RGB555 format masks would look like the following example:
NOTE: For 16 bits-per-pel, the upper half of the DWORDs are always zeroed.
The RGB888 format masks would look like the following example:
UsageWhen using 16 and 32-bit formats, there are also certain fields of the BITMAPINFOHEADER structure that must be set to the correct values:
Windows 95In Windows 95, if the BI_BITFIELDS flag is set, then a color mask must be specified and it must be one of the following:
User-defined color masks are not available under Windows 95.
Additional query words: bpp bmp
Keywords : kbfile kbsample kbBitmap kbGDI kbNTOS350 kbNTOS351 kbWinOS2000 kbSDKWin32 kbWinOS95 kbDSupport |
Last Reviewed: December 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |