Re: [android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
Guys , I finally found the solution for my original problem.So thought of sharing it if someone has the same in the future. Using the 3 images itself ,my problem was solved by adding a zero padding explicitly android:paddingLeft=0dip android:paddingRight=0dip android:paddingTop=0dip android:paddingBottom=0dip Maybe Android 1.5 is taking padding 0 dip for the compound drawables but later on its adding some padding by default from 1.6 and specifying padding as 0 explicitly solves the problem.This solution was found just by fluke..But it has solved a major headache for me .. Thanks and Regards, Alok. On Thu, May 6, 2010 at 7:24 PM, Alok Kulkarni kulsu...@gmail.com wrote: Oh ok.. Thanks for that.. ill try that and will let you know... Regards, Alok. On Thu, May 6, 2010 at 3:36 PM, skink psk...@gmail.com wrote: On May 6, 5:52 am, skink psk...@gmail.com wrote: reading this: http://groups.google.com/group/android-developers/msg/db8d63fd8575129c it seems ninePatches are created statically by aapt tool and if you want to create ninepatchdrawable dynamically from any file you would calculate chunk by yourself (ResourceTypes.h for its format) pskink so if creating NinePatcheDrawable is not an easy thing (due to binary chunk format) i thing the best idea for OP is to create custom drawable extending StateListDrawable pskink -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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
[android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
On May 5, 2:37 pm, Alok Kulkarni kulsu...@gmail.com wrote: It would be great if you could help me giving an example of using the inflate method and the NinePatchDrawable constructor. Thanks, Alok. reading this: http://groups.google.com/group/android-developers/msg/db8d63fd8575129c it seems ninePatches are created statically by aapt tool and if you want to create ninepatchdrawable dynamically from any file you would calculate chunk by yourself (ResourceTypes.h for its format) pskink -- 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
[android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
On May 6, 5:52 am, skink psk...@gmail.com wrote: reading this:http://groups.google.com/group/android-developers/msg/db8d63fd8575129c it seems ninePatches are created statically by aapt tool and if you want to create ninepatchdrawable dynamically from any file you would calculate chunk by yourself (ResourceTypes.h for its format) pskink so if creating NinePatcheDrawable is not an easy thing (due to binary chunk format) i thing the best idea for OP is to create custom drawable extending StateListDrawable pskink -- 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
Re: [android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
Oh ok.. Thanks for that.. ill try that and will let you know... Regards, Alok. On Thu, May 6, 2010 at 3:36 PM, skink psk...@gmail.com wrote: On May 6, 5:52 am, skink psk...@gmail.com wrote: reading this: http://groups.google.com/group/android-developers/msg/db8d63fd8575129c it seems ninePatches are created statically by aapt tool and if you want to create ninepatchdrawable dynamically from any file you would calculate chunk by yourself (ResourceTypes.h for its format) pskink so if creating NinePatcheDrawable is not an easy thing (due to binary chunk format) i thing the best idea for OP is to create custom drawable extending StateListDrawable pskink -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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
[android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
On May 5, 6:25 am, Alok Kulkarni kulsu...@gmail.com wrote: For 9 patch images i suppose they need to be stored under drawable folder. I need to change the images according to theme at runtime. at runtime you can create NinePatchDrawable instance based on Bitmap as well pskink -- 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
[android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
On May 5, 6:46 am, Alok Kulkarni kulsu...@gmail.com wrote: Can you show me an example if possible ? use this ctor: http://developer.android.com/intl/fr/reference/android/graphics/drawable/NinePatchDrawable.html#NinePatchDrawable(android.content.res.Resources, android.graphics.Bitmap, byte[], android.graphics.Rect, java.lang.String) pskink -- 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
Re: [android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
Okay i have a question here .. I am trying to use the draw9patch tool in the sdk folder. I took an image btn_media_player.9 from the SDK folder path which skink had given In the code i did the following String path = data/data/com.android.test.themes/default/images/btn_media_player.9.png; Drawable npd = NinePatchDrawable.createFromPath(path); btn.setBackgroundDrawable(npd); But this is not working.. The image is getting stretched.I have attached the screenshot. Am i doing anything wrong ? On Wed, May 5, 2010 at 3:52 PM, skink psk...@gmail.com wrote: On May 5, 6:46 am, Alok Kulkarni kulsu...@gmail.com wrote: Can you show me an example if possible ? use this ctor: http://developer.android.com/intl/fr/reference/android/graphics/drawable/NinePatchDrawable.html#NinePatchDrawable(android.content.res.Resourceshttp://developer.android.com/intl/fr/reference/android/graphics/drawable/NinePatchDrawable.html#NinePatchDrawable%28android.content.res.Resources , android.graphics.Bitmap, byte[], android.graphics.Rect, java.lang.String) pskink -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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=enattachment: 9 patched.JPG
[android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
On May 5, 8:48 am, Alok Kulkarni kulsu...@gmail.com wrote: Okay i have a question here .. I am trying to use the draw9patch tool in the sdk folder. I took an image btn_media_player.9 from the SDK folder path which skink had given In the code i did the following String path = data/data/com.android.test.themes/default/images/btn_media_player.9.png; Drawable npd = NinePatchDrawable.createFromPath(path); btn.setBackgroundDrawable(npd); But this is not working.. The image is getting stretched.I have attached the screenshot. Am i doing anything wrong ? try createFromStream pskink -- 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
Re: [android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
Can you try the attached .9.png? See if it scales? -- Kostya Alok Kulkarni kulsu...@gmail.com писал(а) в своём письме Wed, 05 May 2010 16:21:43 +0400: Does not make any difference between both ir CreateFromStream and CreateFromPath Apparantly i am having a problem creatnig the image in the Draw9 patch.. I have attached the screen shot. I can see that the corners are getting stretched even when i have specified stretching at the centre.. Help please :):) On Wed, May 5, 2010 at 4:49 PM, skink psk...@gmail.com wrote: On May 5, 8:48 am, Alok Kulkarni kulsu...@gmail.com wrote: Okay i have a question here .. I am trying to use the draw9patch tool in the sdk folder. I took an image btn_media_player.9 from the SDK folder path which skink had given In the code i did the following String path = data/data/com.android.test.themes/default/images/btn_media_player.9.png; Drawable npd = NinePatchDrawable.createFromPath(path); btn.setBackgroundDrawable(npd); But this is not working.. The image is getting stretched.I have attached the screenshot. Am i doing anything wrong ? try createFromStream pskink -- 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.comandroid-developers%2bunsubscr...@googlegroups.com 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 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=enattachment: slim_spinner_normal.9.png
Re: [android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
Kostya, even the spinner didnt work as expected.. Its image too got expanded.Though i gave it to a button. I have attached screen shots 1st one has 2 images left one is larger text and right one is smaller text The white border on the left and right hand side of the button is expanding for larger text which is what i dont want ... The 2nd image is the spinner image On Wed, May 5, 2010 at 5:51 PM, Alok Kulkarni kulsu...@gmail.com wrote: Does not make any difference between both ir CreateFromStream and CreateFromPath Apparantly i am having a problem creatnig the image in the Draw9 patch.. I have attached the screen shot. I can see that the corners are getting stretched even when i have specified stretching at the centre.. Help please :):) On Wed, May 5, 2010 at 4:49 PM, skink psk...@gmail.com wrote: On May 5, 8:48 am, Alok Kulkarni kulsu...@gmail.com wrote: Okay i have a question here .. I am trying to use the draw9patch tool in the sdk folder. I took an image btn_media_player.9 from the SDK folder path which skink had given In the code i did the following String path = data/data/com.android.test.themes/default/images/btn_media_player.9.png; Drawable npd = NinePatchDrawable.createFromPath(path); btn.setBackgroundDrawable(npd); But this is not working.. The image is getting stretched.I have attached the screenshot. Am i doing anything wrong ? try createFromStream pskink -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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=enattachment: Difference.JPGattachment: spinner.JPG
Re: [android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
Alok, Found this discussion about creating nine-patches programmatically. Hope this is useful. http://www.mail-archive.com/android-developers@googlegroups.com/msg26977.html -- Kostya Alok Kulkarni kulsu...@gmail.com писал(а) в своём письме Wed, 05 May 2010 17:06:32 +0400: Kostya, even the spinner didnt work as expected.. Its image too got expanded.Though i gave it to a button. I have attached screen shots 1st one has 2 images left one is larger text and right one is smaller text The white border on the left and right hand side of the button is expanding for larger text which is what i dont want ... The 2nd image is the spinner image On Wed, May 5, 2010 at 5:51 PM, Alok Kulkarni kulsu...@gmail.com wrote: Does not make any difference between both ir CreateFromStream and CreateFromPath Apparantly i am having a problem creatnig the image in the Draw9 patch.. I have attached the screen shot. I can see that the corners are getting stretched even when i have specified stretching at the centre.. Help please :):) On Wed, May 5, 2010 at 4:49 PM, skink psk...@gmail.com wrote: On May 5, 8:48 am, Alok Kulkarni kulsu...@gmail.com wrote: Okay i have a question here .. I am trying to use the draw9patch tool in the sdk folder. I took an image btn_media_player.9 from the SDK folder path which skink had given In the code i did the following String path = data/data/com.android.test.themes/default/images/btn_media_player.9.png; Drawable npd = NinePatchDrawable.createFromPath(path); btn.setBackgroundDrawable(npd); But this is not working.. The image is getting stretched.I have attached the screenshot. Am i doing anything wrong ? try createFromStream pskink -- 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.comandroid-developers%2bunsubscr...@googlegroups.com 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 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
[android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
On May 5, 11:30 am, Kostya Vasilyev kmans...@gmail.com 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 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
Re: [android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
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 psk...@gmail.com wrote: On May 5, 11:30 am, Kostya Vasilyev kmans...@gmail.com 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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
Re: [android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
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 kulsu...@gmail.com писал(а) в своём письме 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 psk...@gmail.com wrote: On May 5, 11:30 am, Kostya Vasilyev kmans...@gmail.com 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com 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 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
Re: [android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
Yes i had created the image fin2.9.png using draw9patch tool.Frankly speaking i am not getting how to use the second method :) Its going like a bouncer to me :) Thanks a lot, Alok 2010/5/5 Kostya Vasilyev kmans...@gmail.com 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 kulsu...@gmail.com писал(а) в своём письме 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 psk...@gmail.com wrote: On May 5, 11:30 am, Kostya Vasilyev kmans...@gmail.com 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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
Re: [android-developers] Re: Problem with StateListDrawables not found in 1.5 but there from 1.6 onwards
It would be great if you could help me giving an example of using the inflate method and the NinePatchDrawable constructor. Thanks, Alok. 2010/5/5 Alok Kulkarni kulsu...@gmail.com Yes i had created the image fin2.9.png using draw9patch tool.Frankly speaking i am not getting how to use the second method :) Its going like a bouncer to me :) Thanks a lot, Alok 2010/5/5 Kostya Vasilyev kmans...@gmail.com 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 kulsu...@gmail.com писал(а) в своём письме 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 psk...@gmail.com wrote: On May 5, 11:30 am, Kostya Vasilyev kmans...@gmail.com 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com 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 android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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