I've been using WINAPI CreateDIBSection()
to draw pixel by pixel then I bitblt to DC. I'm curious. What is going on with CreateDIBSection's underlying data structures? The BITMAPINFO struct stores the width height of the screen/client. Then the VOID **ppvBits, handles the 24 bit colors. So could this all be looked at as a 3D array? Similar to this
int pixels[height][width][color]?
The reason I ask is this CreateDIBSection()
function is very very fast, yet if I create a similar array of (900*1800*(246*256*256)) it is really really slow.
How does Microsoft get this method so fast and efficient? I've tried everything. Int*** pointers to pointer to pointer, int*** malloc
, tried NEW
etc, they are all very slow on large arrays. I'm just curious how I can construct a 3D array that performs as well. Any thoughts?
I need an array about 20000x1800x100000. CreateDIBSection()
stores this swiftly with no problems. But how about a standard C/C++ dynmaic array?
I need to store what's in the CreateDIBSection()
and BITMAPINFO
in a 2nd array.