图像管理和缩放
我正在开发动态壁纸,我想知道如何管理高质量图像。顺便说一句,我对 Android 开发还很陌生。 我有 2 个问题:
1)我用于创建壁纸的图像是矢量图像(2560w x 1600h,32 位,10mb),非常脆且具有非常高的分辨率。我尝试将它作为壁纸,它看起来非常棒(在我的平板电脑上)。我将它放在 drawable
文件夹中。这会生成一个高维 .apk
文件 (9 Mb)。 拥有这么大的文件放大 apk 尺寸是否可以,还是尽可能减小它是一个好习惯?
2) 从 Engine
类构建我的壁纸时 < strong>我想知道,将上面的图像设置为壁纸后,将其缩放到与屏幕尺寸无关的 XY 位置的最佳做法是什么。
PS:我发现最完美的是当您尝试将图像设置为壁纸时,Android 使用默认系统。在这种情况下系统会做什么?
谢谢:)
I am developing a live wallpaper and I would like to know how to manage high quality images. I am quite new to android development by the way.
I got 2 questions:
1)The image I use for wallpaper creation is a vector image (2560w x 1600h, 32bit, 10mb exactly), very crispy and with really high resolution. I tried it as a wallpaper and it looks just fantastic (on my tablet). I placed it in the drawable
folder. This results in a high dimension .apk
file (9 Mb). Is it ok to have files this big enlarge apk dimension or it is a good practice to reduce it as much as possible?
2)When building my wallpaper from the Engine
class i'd like to know, after setting the above image as a wallpaper, what is the best practice to scale it fitting XY independant of screen sizes.
PS: What i found to be perfect was the default system android use when you attempt to set an image as wallpaper. What does the system do in that case?
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1.)据我所知,没有任何 Android 设备支持大于 1280x760 的分辨率,因此使用比这更大的图像并不是一个好的做法,因为它们会毫无意义地使用大量空间。
2.) DisplayMetrics 类包含与此问题相关的所有内容。
1.)Since no android device supports resoultion bigger than 1280x760 of what I know, it is not a good practice in having images with bigger size than this as they use a lot of space for nothing.
2.)The DisplayMetrics class has everything you need related to this problem.