1

Normally an image which has been 9-sliced will stretch automatically if it is loaded from a resource. Is it possible to retain this functionality when loading the image using a file path and BitmapFactory?

drhodes
  • 41
  • 6

2 Answers2

0

I have not tried this, but it seems as though you can just create a NinePatchDrawable with the Bitmap, check out the docs.

Edit: Hmmm... it might not be as simple as it seems, see this answer.

Community
  • 1
  • 1
dmon
  • 30,048
  • 8
  • 87
  • 96
0

"9-patch", but yes. See the constructor for NinePatch.

kabuko
  • 36,028
  • 10
  • 80
  • 93