How to load to C++ 8-bit bitmap image (.bmp file from path) without using external libraries ? How to find dimensions of that bitmap ? (I googled but every solution requires external library )
1 Answers
What do you mean by "bitmap"? There are several image formats. Do you mean a .bmp - file?
In any case, you should find the format specification of the particular file and read the dimensions from the header first. Then read the data. The dimensions are not the only important values. An image could contain more bytes per row then actual pixels i.e. Or the coordinates could be flipped, etc. In general, not using an image library is not a good idea.
But, maybe you have to (possibly because you use some exotic CPU-architecture) Here you can find routines e.g for reading png-files. All examples are self contained and don't use libraries. http://www.ipol.im/
EDIT:
since you've specified, that it should be BMP-format, this question should be of help for you: Getting the pixel value of BMP file

- 1
- 1

- 7,240
- 12
- 61
- 111