Teach the concept of "unit of compilation".
Here, unfortunately, there are things that should be in the. CPP file, and things should be in an. H file.
The data structure we need a "one to one" with no bytes of padding.
struct FileHeader struct MAPINFO
The BMP format. Do not forget that the BMP format is written with the bottom row!
The Open function reads the image "as is", Save writes "one to one", GetMapInfo, and GetFH give some titles of our BMP.
Remains GetMap(), which, in theory, should produce a matrix of colors, but really only works for 32-bit BMP and in no way encapsulates nor the width-height of the matrix, nor the fact that the BMP format is written with the bottom row.
This code is a C — minus.
Now, why your code does NOT, but, the idea needs to accomplish your objective.
1. Create a BMP of the right size from scratch, not loading from a file.
2. To encapsulate the matrix of pixels. It is advisable so that quick access strings as memory buffers, for ease of transfer of information from the old to the new BMP 30×30 pixels bigger.
3. If you limited support the format of BMP — exit with error if the version is unsupported (e.g., not the number of colors).
The task is on their own
to support BMP? And then the Builder is TBitmap.