Venkata Krishna
Venkata Krishna

Reputation: 1603

How to display small size image as large size image without losing the clarity of image in android?

I want to display the background image for one image view and text view.My problem is my background image should grow and shrink depending on it's child views without losing the image quality.

Upvotes: 2

Views: 376

Answers (2)

0xC0DED00D
0xC0DED00D

Reputation: 20368

You can use setDensity(int density) method on Bitmap. You can change the density every time you want to change the size of the image.

http://developer.android.com/reference/android/graphics/Bitmap.html#setDensity(int)

Upvotes: 0

adamp
adamp

Reputation: 28932

If you can define specific regions within your background that should stretch versus areas that should stay anchored in the same position regardless of size, 9-patches may be what you are looking for. These are perfect for creating resizable frames for content.

Upvotes: 2

Related Questions