bmp图片中biXPelsPermeter biYPelsPermeter值的含义

来源:互联网 发布:51单片机初始化 编辑:程序博客网 时间:2024/06/05 04:43

总结:biXPelsPermeterbiYPelsPermeter 只给显示器打印机的一个参考值,当需要不同的尺寸打印出来的时候可以用软件缩放图像,理论上可以随便改变这个值尽管不改变具体的像素数据,但会导致有些软件缩放这个图片出现问题。

像素密度:PPI(Pixels Per Inch),一英寸等于2.54cm,一般电脑手机的分辨率是指在电脑手机规格的大小下的长宽的像素数,像素密度才是真正度量屏幕精细程度的标准。计算一般是勾股定理得到对角线的像素数/对角线的长度(inch)得到像素密度。电脑手机显示图片的时候是会根据图片的像素数 / 自己的像素密度 = 图片显示尺寸。所以同一个显示器不同的分辨率设置下显示的图片大小会不一样,电脑上面显示的图片和手机上显示的图片大小会不一样。


biXPelsPermeter Specifies the horizontal print resolution, in pixels per meter, of the target device for the bitmap.

biYPelsPermeter Specifies the vertical print resolution.

Its not very important. You can leave them on 2835 its not going to ruin the image. (72 DPI × 39.3701 inches per meter yields 

2834.6472) 一寸等于2.54cm.


Think of it this way: The image bits within the BMP structure define the shape of the image using that much data (that much information describes the image), but that information must then be translated to a target device using a measuring system to indicate its applied resolution in practical use.

For example, if the BMP is 10,000 pixels wide, and 4,000 pixels high, that explains how much raw detail exists within the image bits. However, that image information must then be applied to some target. It uses the relationship to the dpi and its target to derive the applied resolution.

If it were printed at 1000 dpi then it's only going to give you an image with 10" x 4" but one with extremely high detail to the naked eye (more pixels per square inch). By contrast, if it's printed at only 100 dpi, then you'll get an image that's 100" x 40" with low detail (fewer pixels per square inch), but both of them have the same overall number of bits within. You can actually scale an image without scaling any of its internal image data by merely changing the dpi to non-standard values.

Also, using 72 dpi is a throwback to ancient printing techniques (https://en.wikipedia.org/wiki/Twip) which are not really relevant in moving forward (except to maintain compatibility with standards) as modern hardware devices often use other values for their fundamental relationships to image data. For video screens, for example, Macs use 72 dpi as the default. Windows uses 96 dpi. Others are similar. In theory you can set it to whatever you want, but be warned that not all software honors the internal settings and will instead assume a particular size. This can affect the way images are scaled within the app, even though the actual image data within hasn't changed.


要计算显示器的每英寸像素值,首先要确定屏幕的尺寸和分辨率。



以屏幕尺寸为4吋的iPhone 5为例,分辨率为1136x640,像素密度为326PPI。而分辨率为1920x1080的家用21.5寸显示器,像素密度为103PPI。

另外,由于屏幕的尺寸有时并不代表其实际的大小(例如苹果公司生产的21.5寸iMac电脑实际对角线长度为21.465寸[6]),因此单凭尺寸算得的每英寸像素值会有一定的误差。同样的一台显示器,如果分辨率设置的不同,像素点数也不同。分辨率越高,每英寸像素值也越高,图像的大小也越小。


根据屏幕每英寸像素值的不同,Android系统的开发者将平板电脑和手机的屏幕分成四类:[11]

名称显示等级每英寸像素值LDPI低等像素密度大约120每英寸像素MDPI中等像素密度大约160每英寸像素HDPI高等像素密度大约180每英寸像素XHDPI极高像素密度大约320每英寸像素
0 0
原创粉丝点击