On Mon, Mar 2, 2009 at 6:26 PM, craiget <crai...@gmail.com> wrote:
>
> Can someone please explain or provide examples (links) of some valid 9-
> patch files?
>
> From reading the API description, I think my understanding is flawed.
>
> As an example, there's a 9-patch located at: 
> http://www.maladroid.net/test.9.png
>
> [the same idea, as abad ascii representation]
>
> 0 = transparent, 1 = black, 2 = red
>
> 010101010
> 102020200
> 102020200
> 102020200
> 102020200
> 000000000
>
> So there are 3 single-red-pixel columns, with stretchable areas
> defined between them. It seems like this should resize to any aspect
> ratio and there will still be 3 single-pixel red columns. My thinking
> is that the solid black border on the left means "scale uniformly in
> the y-direction" and that a pixel in the top row above the transparent
> columns means "scale the transparent area, but leave the red columns
> with width=1 pixel".
>
> Is that the correct interpretation of black/transparent pixels?
>
> Using the draw9patch tool, it doesn't scale if I make the left-border
> completely black, but if I remove any one pixel, then it scales - why
> is that?

Because a ninepatch consists of 9 patches, only 5 of which are scaled,
while the 4 corners are not scaled. An image that has a black top-left
pixel therefore cannot be a ninepatch image. The draw9patch tool
shouldn't even let you set the top-left to black.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to