为什么 BITMAPS 加载“向上”?
如果您有一个非常非常大的 JPG 和嵌入 HTML 的 BMP,并将其加载到 Firefox 中,您会注意到 JPG 将“向下”加载(从左到右绘制,然后向下),而 BMP 将“向上”加载(从右向左绘画,然后向上)。
只是好奇。 :)
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. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不久前写了一个位图解析器,如果我没记错的话,位图向后存储图像。也就是说,它首先存储较低的行,最后存储较高的行。数据按顺序到达您的浏览器,因此您可以观看它从下往上加载。
编辑:这里有一个更好的链接,它几乎可以告诉您有关位图文件的所有信息: http: //en.wikipedia.org/wiki/BMP_file_format
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
位图坐标从屏幕的左下角开始 - 如果您想到一个图表,那么这非常有意义,您从左下角开始原点。
大多数图形设备从左上角开始 - 因为 CRT 等光栅扫描显示器从顶部开始扫描(为什么?),而 LCD 则延续了标准
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