加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

窗户 – 为什么bmps倒置?

发布时间:2020-12-14 00:48:45 所属栏目:百科 来源:网络整理
导读:为什么BMP图像被颠倒和零填充,因此它们是四字节对齐的? 这是Petzold的报价: So,in DIBs,the bottom row of the image is the first row of the file, and the top row of the image is the last row in the file. This is called a bottom-up organization
为什么BMP图像被颠倒和零填充,因此它们是四字节对齐的?
这是Petzold的报价:

So,in DIBs,the bottom row of the image is the first row of the file,
and the top row of the image is the last row in the file. This is
called a bottom-up organization. Because this organization is
counterintuitive,you may ask why it’s done this way.

Well,it all goes back to the OS/2 Presentation Manager. Someone at
IBM decided that all coordinate systems in PM—including those for
windows,graphics,and bitmaps—should be consistent. This provoked a
debate: Most people,including programmers who have worked with
full-screen text programming or windowing environments,think in terms
of vertical coordinates that increase going down the screen. However,
hardcore computer graphics programmers approach the video display from
a perspective that originates in the mathematics of analytic geometry.
This involves a rectangular (or Cartesian) coordinate system where
increasing vertical coordinates go up in space.

In short,the mathematicians won. Everything in PM was saddled with a
bottom-left origin,including window coordinates. And that’s how DIBs
came to be this way.

资料来源:Charles Petzold,Windows编程第5版,第15章.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读