Creating a DIB section from a BMP file

A DIB section is somewhat like the DIB in that it provides access to the bitmap bits for direct modification by the application. But unlike a DIB handle, a DIB section can be used with most GDI functions, including the BitBlt() and StretchBlt() functions. If you are familiar with the LoadImage() function, you know that this function can be used to create a DIB section from a bitmap file by using the LR_LOADFROMFILE flag. Although the documentation says that this flag is not supported in NT, the truth is that it works only partly on NT. Using the LoadImage() function on NT 4.0 with the LR_LOADFROMFILE flag will create a DIB section but the color information in the DIB section is not proper. The function given below works on NT as well as Windows 95.

Top White Papers and Webcasts

The 2014 State of DevOps Report — based on a survey of 9,200+ people in IT operations, software development and technology management roles in 110 countries — reveals:
Companies with high-performing IT organizations are twice as likely to exceed their profitability, market share and productivity goals.
IT performance improves with DevOps maturity, and strongly correlates with well-known DevOps practices.
Job satisfaction is the No. 1 predictor of performance against organizational …

Companies undertaking an IT project need to find the right balance between cost and functionality. It's important to start by determining whether to build a solution from scratch, buy an out-of-the-box solution, or a combination of both. In reality, most projects will require some system tailoring to meet business requirements. Decision-makers must understand how much software development is enough and craft a detailed implementation plan to ensure the project's success. This white paper examines the different …