Damir
Damir

Reputation: 56199

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

How to convert char** to bitmap ? I have image width x height and matrix of chars 3 * width x height ( every pixel is represented like triplet of char red, char green, char blue). I filled this matrix from another loaded bitmap (I need just smaller rectangle of original bitmap so I filled in char**/matrix). How to write this new char** to .bmp file ? I tried like http://www.cplusplus.com/forum/beginner/12848/

but it has strange behavior.

Upvotes: 0

Views: 980

Answers (1)

Alex I
Alex I

Reputation: 20287

A few possible directions:

  1. Use Microsoft APIs: CImage or CBitmap

  2. Use existing library: http://code.google.com/p/libbmp/ or http://easybmp.sourceforge.net/ or http://sourceforge.net/projects/cimg/ or http://people.sc.fsu.edu/~jburkardt/cpp_src/bmp_io/bmp_io.html or ImageMagick (many more)

  3. Don't use library, start here: Writing BMP image in pure c/c++ without other libraries

Upvotes: 1

Related Questions