Why do BITMAPS load “upwards”?

前端 未结 2 1024
有刺的猬
有刺的猬 2021-02-18 15:30

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, th

2条回答
  •  时光取名叫无心
    2021-02-18 16:21

    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

提交回复
热议问题