Search code examples
javaandroidbitmapuiimageviewnine-patch

Android 9 patch blurry?


I created a 9 patch png via androids tools but it appears blurry on my 260 ppi device.

I resized my image in Photoshop down to 48 x 69 as 9patch drawer recommends images to be as small as possible, because it supports scaling up not down.

I saved my image transparently as a png, its basically a transparent rectangle with a stroke.

Loaded in 9 patch drawer, outlined the stretchable areas (TOP and LEFT)

Saved the image...

Loaded it into an image button... but the image is blurry?

I re did the whole process but without resizing in Photoshop, and instead resizing in android and now its clear and sharp..?

Why is this? I thought 9patch scaled up sharply?


Solution

  • Well, let's see a shot of the image, but more than likely the problem is that 9 patch is intended to be used in situations where you want to replicate pixels. So you need a more or less uniform area of pixels that you're looking to stretch.