Chapter 12. Image Processing Using Windows Bitmaps

The benefit of device-independent bitmaps and DIB sections is that applications can directly access their pixel arrays and color tables. Often this direct access is a critical technique to implement features not provided by GDI, or to achieve improved performance not feasible using GDI calls.

So far, we have seen both cases. When we talked about simulating PlgBlt, we used GDI's pixel access API GetPixel and SetPixel. We found out that it's much slower than GDI's Windows 2000 implementation. Each individual GetPixel and SetPixel call has the overhead of parameter validation, user-mode to kernel-mode switching, color translation, etc. GetPixel even creates a temporary bitmap to call the internal ...

Get Windows Graphics Programming Win32 GDI and DirectDraw® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.