Why do BITMAPS load “upwards”?

强颜欢笑 提交于 2019-12-05 09:39:42

问题


If you have a really really large JPG and a BMP embedded on HTML and you load it into Firefox, you will notice that the JPG will load "downwards" (paint from left to right, then down) and the BMP will load "upwards" (paint from right to left, then up).

Just curious. :)


回答1:


I wrote a bitmap parser a while back, and if I remember correctly, bitmaps store the image backwards. That is, it stores the lower rows first and the higher rows last. The data arrives to your browser in-order, so that's why you can watch it load from the bottom up.

EDIT: Here's a better link that pretty much tells you everything you would ever want to know about a bitmap file: http://en.wikipedia.org/wiki/BMP_file_format




回答2:


Bitmap coordinates start at the bottom left of the screen - this makes perfect sense if you think of a graph, you start the origin at the lower left.

Most graphics devices start at the top left - because raster scanning displays like CRTs started the scan at the top (why?) and LCDs continued the standard



来源:https://stackoverflow.com/questions/3601889/why-do-bitmaps-load-upwards

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!