You can find examples of 9patch files in the SDK, in tools/lib/res/
default/drawable/
The .9.png files are 9patches.

http://www.deepdroid.com


On Mar 3, 3:26 am, 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?
>
> When working in Eclipse, after refreshing the /drawables folder,
> sometimes my 9-patch doesn't show up in the R.java file, presumably
> because it is somehow invalid. Yet, I can still refer to it and use it
> in the Layout Editor. Am I correct to assume there's something wrong
> with the 9-patch? Or perhaps there's something wrong with my (default
> eclipse plugin) build process?
>
> Thank you for any suggestions.
--~--~---------~--~----~------------~-------~--~----~
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