如何根据移动的MDPI,HDPI和屏幕大小调整位图图像 [英] How to resize the bitmap image according to mdpi,hdpi and screen size of the mobile

查看:261
本文介绍了如何根据移动的MDPI,HDPI和屏幕大小调整位图图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的图像说85x85像素(投入绘-MDPI这个图片)

I am using image say 85x85 px (putting this image in drawable-mdpi)

和如果我[小320x480] MDPI的屏幕尺寸设备上显示85x85像素的这一形象看起来不错,
但同时显示这一形象[480×800] MDPI设备,它看起来非常小。

and if i am displaying this image of 85x85 px on [320x480]mdpi screen size device it looks good, but while displaying this image on [480x800]mdpi device it looks very small.

我想知道我怎么可以调整(85x85像素)的这一形象,使其具有屏幕宽度和为480x800的高度,正常工作的设备MDPI。

I wants to know how can i resize this image of (85x85 px) so that it works fine for the device having screen width and height of 480x800, mdpi.

推荐答案

您必须设置图片大小在DP的XML。 <一href=\"http://stackoverflow.com/questions/2025282/difference-between-px-dp-dip-and-sp-in-android\">This帖子是真正有用的。

You have to set the image size in the xml in dp. This post is really helpful.

这篇关于如何根据移动的MDPI,HDPI和屏幕大小调整位图图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆