List of usage examples for android.graphics.drawable VectorDrawable getIntrinsicWidth
@Override public int getIntrinsicWidth()
From source file:com.github.topbottomsnackbar.TBSnackbar.java
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private static Bitmap getBitmap(VectorDrawable vectorDrawable) { Bitmap bitmap = Bitmap.createBitmap(vectorDrawable.getIntrinsicWidth(), vectorDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);/*w w w .j a va 2s.c o m*/ Canvas canvas = new Canvas(bitmap); vectorDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); vectorDrawable.draw(canvas); return bitmap; }