knightsbore
knightsbore

Reputation: 480

Converting Bitmap to a vector of unsigned char

As the title says, I'm trying to find a method of converting a GDI+ Bitmap to a vector of unsigned chars, any help would be greatly appreciated.

Upvotes: 1

Views: 1616

Answers (1)

Mark Ransom
Mark Ransom

Reputation: 308530

Have a look at Bitmap::LockBits. Once you've locked the bits, it should be trivial to copy them to a vector<unsigned char>. Better yet, resize the vector to the required size and let LockBits copy directly to it.

Upvotes: 2

Related Questions