Android DPI - 谎言?

发布于 2024-10-22 03:38:16 字数 270 浏览 11 评论 0原文

因此,我为 Android UI 创建了一组资源 - 320 x 400 和 320 x 400。 480 x 800 这两个在 160 和 240 dpi...

在将一些资源绘制为 9 补丁后,发生了奇怪的事情。 9 个补丁图形全部“出来”为 72 dpi,但尺寸不同!

所以我的结论是 Android 资产创建的工作方式与 iPhone 类似。创建尺寸的资产并忽略 DPI(使用 72 作为基础 - 因为这也是 9 补丁程序转换它们的内容!)对吗?

还有其他人尝试过这个吗?

So I create sets of assets for an Android UI - 320 x 400 & 480 x 800 both of these at 160 and 240 dpi...

After Drawing some of the assets as 9 patch a weird thing happened. The 9 patch graphics all 'came out' as 72 dpi but with different dimensions!

So my conclusion is that android asset creation works similiar to iPhone. Creatings assets to dimensions and ignore DPI (using 72 as a base - as this is what the 9 patch programme converted them too!) RIGHT?

Anyone else experimented with this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

把人绕傻吧 2024-10-29 03:38:16

想一想 DPI 是什么。每英寸点数。对于显示器来说,它实际上是每英寸像素数,即 PPI。

每英寸 160 像素的 320 像素宽图像的宽度为 320 像素。 320 像素的图像在 240 像素处的宽度是多少像素? PPI 密度仅对实际输出设备重要。您的显示器具有固定数量的像素和固定的物理尺寸。 1英寸的像素数就是它的PPI密度。对于图形来说,这是可以修改的,因为密度可能不同。最常见的是,这用于打印(这是点的来源)。大多数打印机可以以多种分辨率进行打印。典型的图像分辨率为 300 dpi,矢量图形和线条艺术为 1200 dpi 或更高。当您在打印图像之前设置 dpi 时,它会告诉打印机每英寸应布置多少个点。 dpi 越高,图像越清晰——假设输入图像实际上足够大以适应该分辨率。

Just think for a minute about what DPI is. Dots per Inch. For displays, it's actually Pixels per Inch, or PPI.

A 320 pixel wide image at 160 pixels per inch is 320 pixels wide. How many pixels wide is a 320 pixel image at 240 pixels? The PPI density only matters on the actual output device. Your display has a fixed number of pixels at a fixed physical size. The number of pixels that fit into 1 inch is its PPI density. The reason this is modifiable for graphics is for when the density can differ. Most commonly, this is for printing (which is where the dots come in). Most printers can print at a variety of resolutions. The typical is something like 300 dpi for images, 1200 dpi or higher for vector graphics and line art. When you set the dpi before printing an image, it tells the printer how many dots per inch it should lay out. The higher the dpi, the sharper the image -- assuming the input image is actually large enough to accomodate this resolution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文