You have to create a NinePatch from the bitmap, and then a NinePatchDrawable from the NinePatch.
http://bit.ly/9nS9xm http://bit.ly/cL5sR2 You're just treating it as a graphic, rather than a NinePatch. The resource system does this for you automatically if it recognizes the . 9.png filename; otherwise, you'll have to do it yourself. On Feb 3, 8:15 pm, brian karlo gutierrez <brikz...@yahoo.com> wrote: > Hello Everyone, > > I have a question regarding 9 patch images. Is it possible to download 9 > patch png files from a webserver then display it as a background of a layout > while keeping the information inside the file like the stretchable pixel? I > have tried using a 9 patch image coming from the resource drawable directory > of my project and it displays correctly...stretching only those pixels marked > as stretchable but when I tried to download a 9 patch image from my web > server then the application will use the downloaded 9 patch image the > stretchable pixels does not take effect..i mean instead of stretching only > those pixels that where marked as stretchable it stretched the whole image... > > the code im using is this one: > > URL url = new URL( imgurl ); > URLConnection con = url.openConnection(); > con.connect(); > this.mStream = con.getInputStream(); > Drawable image = BitmapDrawable.createFromStream(this.mStream, imgfn); > this.mStream.close(); > this.mImageLayout.setBackgroundDrawable( image ); > > Hoping for some help. > > Thanks, > > Brian -- 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