Reputation: 14244
How can I convert a bitmap to a byte array in c++ WITHOUT the .net framework?
Upvotes: 6
Views: 6896
Reputation: 10989
If your bitmap is a device independent bitmap, you can access the pixel data using GetObject and passing in a BITMAP. This avoids making a copy of the pixel data.
Upvotes: 0
Reputation: 546153
If you’re using Windows, you can use GetDIBits
to retrieve the bitmap data.
Upvotes: 5