::LoadImage is to DIB sections what ::LoadBitmap and CDC::LoadBitmap are to DDBs. But it's also much more. I won't rehash all the input values it accepts because you can get that from the documentation, but here's a short summary of some of the things you can do with ::LoadImage:
- Load bitmap resources, and create DDBs and DIB sections from them.
- Load bitmaps stored in BMP files, and create DDBs and DIB sections from them.
- Automatically convert three shades of gray (RGB (128, 128, 128), RGB (192, 192, 192), and RGB (223, 223, 223)) to the system colors COLOR_3DSHADOW, COLOR_3DFACE, and COLOR_3DLIGHT as an image is loaded.
- Automatically convert the color of the pixel in the upper left corner of the bitmap to the system color COLOR_WINDOW or COLOR_3DFACE so that the pixel and others like it will be invisible against a COLOR_WINDOW or COLOR_3DFACE background.
- Convert a color image to monochrome.
Keep in mind that ::LoadImage's color-mapping capabilities work only with images that contain 256 or fewer colors. DIBs with 256 or fewer colors contain built-in color tables that make color mapping fast and efficient. Rather than examine every pixel in the image to perform a color conversion, ::LoadImage simply modifies the color table.