Android Studio中较大的位图三倍 [英] Bitmap three times larger in Android Studio
问题描述
我开发一个Android应用程序的启动画面,我想简单地把在Photoshop设计为背景的图片。问题是,当我将图像保存其第1080点¯x1920年,但是当我将其添加为Android Studio中被拉伸,它给我的错误位图太大......并说,这项决议是3240点¯x5760 (正好3大次)。我想不通为什么会这样,你能帮帮我吗?
I'm developing the splash screen for an Android application and I wanted to simply put an image designed in Photoshop as a background. The problem is that when I save the image its resolution is 1080 x 1920, but when I add it as a drawable in Android Studio, it gives me the error "Bitmap too large..." and says that the resolution is 3240 x 5760 (exactly 3 times bigger). I can't figure out why this happens, can you please help me?
感谢
推荐答案
Android中绘制
文件夹实际上重新presents 绘制,于mdpi
文件夹中。
drawable
folder in Android actually represents drawable-mdpi
folder.
如果你把绘制
文件夹,他们将在设备具有更高的像素进行放大的图像。这就是为什么你得到更大的图像。
If you put images in drawable
folder they will be upscaled in devices with higher dpi. That is why you are getting larger image.
把你的形象在绘制-nodpi
文件夹以prevent自动向上或向下的图像缩放。
Put your image in drawable-nodpi
folder to prevent automatic up or down scaling of images.
这篇关于Android Studio中较大的位图三倍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!