bmp - BMP 文件的方向 : upright or upside-down?

标签 bmp file-format

我正在开发一个程序来调整 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/

相关文章:

image - 包含使用很少使用的功能的图像的 GIF 测试套件

c++ - 在窗口中显示 BMP 图像 (C/C++) - 图像消失

java - 当我使用 Launch4j 添加启动画面时,出现启动错误 ("An error occurred while starting the application")

delphi - 加载 Jpg/Gif/Bitmap 并转换为 Bitmap

objective-c - 使用 CGPDFScanner 仅从 PDF 文件中提取文本

directx - 编译的directx9着色器文件的格式?

c++ - 在控制台上显示 BMP 图像时堆损坏

c - 如何将灰度图像导入 C 中的二维矩阵?

c++ - Reading BMP file C++(读取BMP文件头有问题)

serialization - 二进制文件和保存的游戏格式