Are you using a NinePatch file (fin2.9.png) created with Android's draw9patch tool? If not, you should be, as a test. The docs say that the ninepatch chunk is stored as a chunk in the 9.png file itself - the lines along the edges of the image are just there for convenience.

If that doesn't help, maybe you could try one of the other method for loading the bitmap.

-- Kostya

Alok Kulkarni <[email protected]> писал(а) в своём письме Wed, 05 May 2010 19:35:40 +0400:

Thanks a lot Kostya for those links..You and Skink have attended to my
problems patiently throughout the day :)
I tried the following
Bitmap bmp =
BitmapFactory.decodeFile("data/data/com.android.test.themes/fin2.9.png");
        byte[] bmpChunks = bmp.getNinePatchChunk();
        NinePatchDrawable npd2 = new NinePatchDrawable(bmp, bmpChunks,
npd.getBounds(), "fin2.9.png");
i didnt know what to give as the 3rd and 4th parameter to NinePatchDrawable
construcor so the third parameter ie Rect was a rectangle returned by the
same button drawable object which was created earlier.
My bitmap object bmp is getting created but the getNinePatchChunk() method
is returning null.
The doc for this function itself says :- "Returns an optional array of
private data, used by the UI system for some bitmaps. Not intended to be
called by applications. "
So apparantly i am not getting a solution to this problem.. Is there any
other way out .. :( :(
Thanks,
Alok

On Wed, May 5, 2010 at 7:58 PM, skink <[email protected]> wrote:



On May 5, 11:30 am, "Kostya Vasilyev" <[email protected]> wrote:
> Alok,
>
> Found this discussion about creating nine-patches programmatically. Hope

> this is useful.
>


also NinePatchDrawable sources will be useful, see inflate() method


http://www.netmite.com/android/mydroid/donut/frameworks/base/graphics/java/android/graphics/drawable/NinePatchDrawable.java

pskink

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




--
Kostya Vasilyev - WiFi Manager + pretty widget - http://kmansoft.wordpress.com/sw

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

Reply via email to