如何在 android 上创建适当大小的可绘制对象,因为它是在 px 图像上设计的 - 知道尺寸、密度等?
How to create proper size drawable on android as it was designed on px image - knowing dimensions,density, etc.?
我真的知道如何为 android 手机创建合适的可绘制对象。
根据 udacity "Android Design for Developers".
的经验教训
目标:在屏幕上创建与在图像上设计的大小相同的可绘制对象。
我知道什么:
- 屏幕尺寸 1440x2560 像素
- 密度为 560 dpi - 即 xxxhdpi
- 所以,dp 尺寸的屏幕是 411x731 dp
- 图标为 158x158 像素
- 我知道我应该把它放在 xxxhdpi 文件夹中。
我是否应该将整个图像缩小到 dp 尺寸(411x731 像素),然后设计 150x150 像素 "man" 以在 android 屏幕中保持与在图像上创建时相同的尺寸?我怎么办?到目前为止,我使用创建 "lucky size of image" 来获得合适的大小,或者我在代码中定义自定义大小。但这不是线索。帮助。
PS。请不要参考支持屏幕 android 页面,因为我在那里。
I do not know what px size should have "man" picture for xxxhdpi to
get the same size as is on image after taking screenshot.
看看。
您的 xxxhdpi 图像尺寸为 158x158 像素。
我们将mdpi 设为1x。
然后,
高清像素 = 1.5 倍
xHDPI = 2x
xxhdpi = 3x
xxxhdpi = 4x
4x = 158x158 (let's add some margin and make it 160x160)
1x = 40x40
1.5x = 60x60
2x = 80x80
3x = 120x120
4x = 160x160
我真的知道如何为 android 手机创建合适的可绘制对象。 根据 udacity "Android Design for Developers".
的经验教训目标:在屏幕上创建与在图像上设计的大小相同的可绘制对象。 我知道什么:
- 屏幕尺寸 1440x2560 像素
- 密度为 560 dpi - 即 xxxhdpi
- 所以,dp 尺寸的屏幕是 411x731 dp
- 图标为 158x158 像素
- 我知道我应该把它放在 xxxhdpi 文件夹中。
我是否应该将整个图像缩小到 dp 尺寸(411x731 像素),然后设计 150x150 像素 "man" 以在 android 屏幕中保持与在图像上创建时相同的尺寸?我怎么办?到目前为止,我使用创建 "lucky size of image" 来获得合适的大小,或者我在代码中定义自定义大小。但这不是线索。帮助。
PS。请不要参考支持屏幕 android 页面,因为我在那里。
I do not know what px size should have "man" picture for xxxhdpi to get the same size as is on image after taking screenshot.
看看。 您的 xxxhdpi 图像尺寸为 158x158 像素。
我们将mdpi 设为1x。 然后, 高清像素 = 1.5 倍 xHDPI = 2x xxhdpi = 3x xxxhdpi = 4x
4x = 158x158 (let's add some margin and make it 160x160)
1x = 40x40
1.5x = 60x60
2x = 80x80
3x = 120x120
4x = 160x160