我正在开发一个程序来调整 BMP 文件的大小并将其存储在一个新文件中。我注意到有些 BMP 完全颠倒存储,而其他 BMP 则只是直立存储。所以我做了两个解决方案来处理这两种情况。我的问题是如何事先知道 BMP 是直立存放还是倒置存放?这样我就可以决定使用哪种解决方案,而不是对每个 BMP 都尝试这两种解决方案!
最佳答案
答案就在 BITMAPINFOHEADER 结构中。
发件人:http://msdn.microsoft.com/en-us/library/windows/desktop/dd318229(v=vs.85).aspx
For uncompressed RGB bitmaps, if biHeight is positive, the bitmap is a bottom-up DIB with the origin at the lower left corner. If biHeight is negative, the bitmap is a top-down DIB with the origin at the upper left corner.
关于bmp - BMP 文件的方向 : upright or upside-down?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49667464/