如何将这个新字符**写入.bmp文件

How to write this new char** to .bmp file?

本文关键字:字符 写入 文件 bmp 新字符      更新时间:2023-10-16

如何将char**转换为bitmap?我有图像width x height和字符矩阵3 * width x height(每个像素都像triplet of char red, char green, char blue一样表示(。我从另一个加载的位图填充了这个矩阵(我只需要原始位图的较小矩形,所以我填充了char**/matrix(。如何将这个新的char**写入.bmp文件?我试过http://www.cplusplus.com/forum/beginner/12848/

但它的行为很奇怪。

几个可能的方向:

  1. 使用Microsoft API:CImage或CBitmap

  2. 使用现有库:http://code.google.com/p/libbmp/或http://easybmp.sourceforge.net/或http://sourceforge.net/projects/cimg/或http://people.sc.fsu.edu/~jburkardt/cpp_src/bmp_io/bmp_io.html或ImageMagick(更多(

  3. 不要使用库,从这里开始:在没有其他库的情况下用纯c/c++编写BMP图像