//这里也可以是从sd卡上面加载.9图片

Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.ic_launcher);

//确认Bitmap是合法的NinePatch文件
if (NinePatch.isNinePatchChunk(bitmap.getNinePatchChunk())) {
  NinePatchDrawable ninePatchDrawable = new NinePatchDrawable(getResources(), bitmap, bitmap.getNinePatchChunk(), new Rect(), null);
}

相关文章:

  • 2022-12-23
  • 2021-10-30
  • 2021-09-26
  • 2022-12-23
  • 2021-09-05
  • 2021-08-09
  • 2021-06-25
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-04
  • 2022-12-23
  • 2021-05-15
  • 2022-03-08
  • 2022-12-23
相关资源
相似解决方案