I'm drawing in a Canvas a background.png image of my game (the image is wider than high because is a scolling background). The images have this sizes:
- drawable-xhdpi: 1817x443 px
- drawable-hdpi: 1363x332 px
- drawable-mdpi: 909x222 px
- drawable-ldpi: 682x166 px
I did some testing:
- On my Oneplus X the image looks pretty good, but on my Samsung Galaxy Nexus and Wiko Iggy the image lose quality.
- Now, if I remove the background.png from xhdpi folder, the image looks good on Oneplus X and Galaxy, but it is still bad on Wiko.
- At the end, if I remove the background.png from both xhdpi and hdpi folder, the image looks good in all mobiles (Ok, the xhdpi version in Oneplus X was a little better, but the mdpi version is still good too).
The drawing code of the 2 scrolling background:
backgroundArea.offsetTo(xBackground, backgroundArea.top);
canvas.drawBitmap(background, null, backgroundArea, mPaint);
backgroundArea.offset(backgroundArea.width(), 0);
canvas.drawBitmap(background, null, backgroundArea, mPaint);
Why are this happening? Why does It not taking the right image for the right mobile and instead it shrinks the bigger available image? How I can solve this? (PS: I'm still using Eclipse ADT).