Possible Duplicate:
Create a NinePatch/NinePatchDrawable in runtime
I'm trying to create a 9 patch image procedurally but can't see how to do it. Is there any way to take a normal PNG/JPG image and adapt it so that I can specify a center width and center height to generate a 9 patch drawable?
I was going to create a bitmap at runtime and add the black edge markers into the bitmap and create the 9 patch from this in the app but reading this thread it seems it's not possible due to additional magic data that is created by the resource compiler so any pointers?
Essentially I know the image will be used for a button and will have 4, 4x4 corners that should not be stretched and the remaining pixels in the center are able to be stretched.