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.
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.
精彩评论