Home > Mobile >  ShapeDrawable. Can directly use BitmapFactory decodeResource obtain Bitmap
ShapeDrawable. Can directly use BitmapFactory decodeResource obtain Bitmap

Time:09-16

I was in the Drawable folder creates a shapeDrawable. XML

<? The XML version="1.0" encoding="utf-8"?>
Android: shape="oval" & gt;
Android: color="@ color/enemyWhite"/& gt;


But I am getting for Bitmap the Drawable in code, and get a null, what's the problem with this approach you
Enemy=BitmapFactory. DecodeResource (MainActivity. Res, R.d. Rawable shapeDrawable)

My goal is to use the Drawable Canvas painting, there are other ways can be directly drawn? Thank you for your attention
  • Related