user37875
user37875

Reputation: 14244

convert bitmap to byte array

How can I convert a bitmap to a byte array in c++ WITHOUT the .net framework?

Upvotes: 6

Views: 6896

Answers (2)

mackenir
mackenir

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

Konrad Rudolph
Konrad Rudolph

Reputation: 546153

If you’re using Windows, you can use GetDIBits to retrieve the bitmap data.

Upvotes: 5

Related Questions