开发者

Android - graphics are big and blurry

I have a graphic designer that helps me with UI development. We start with me taking screenshots of my current UI using my Nexus One (800x485). Then he overlays new art over the old screenshots in Photoshop and creates transparent PNGs. Then I take that, plug it in my app and to my dismay these images appear big and blurry (about 35% larger). When I 开发者_JAVA技巧check images these are created at 72 dpi so I really have no idea why this is happening. Any ideas?


You need to put the graphics in the correct configuration directory for the target screen. If they are being designed for N1, that 800x480 screen is a high density screen, so the graphics need to go in drawable-hdpi. Not in the generic drawable directory, which for backwards compatibility is assumed to be mdpi.


I edited my answer since it was not the correct one.

Other idea, how are you handling your draws ? (if your using a custom view draw you could post the code if this doesn't help).

I'm asking because there is a trap while drawing with the dimensions:

are you using

bitmap.getScaledWidth

instead of

bitmap.getWidth

that could lead to imprecise/bigger images.

The current idea I have in mind is: (easier to explain with an example):

you have an image of 100*100

you display

you capture it

you edit it and make it pretty

you reinject it

you display it but because your on a high res the dp scales it and it gives it a bad aspect

I don't know if I'm being very clear. but if your using a custom view for your display then you should check your scales.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜