Pergunta

In my app, I have a logo. At first, I used an image that I put in the Drawables folder (in three different sizes).

Now I download it as a string from a web service, converting it to a drawable and displaying it. I've put the image in it's three different sizes on the web service and I've created a function on the service that returns the image in one of the three sizes depending on the downloading unit's DPI.

It doesn't really work as expected, though, since the actual size of the images varies greatly between a low DPI and high DPI unit (I'm using an emulator and an actual phone, respectively). My goal is to download the image and then display it in an DPI independent fashion, so the actual size is the same on all screen sizes, as were the case in the beginning.

Foi útil?

Solução

The problem was easily solved using the setTargetDensity(int density) method in the BitmapDrawable.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top