private Bitmap getBitmapFromDrawable(Drawable drawable) { if (drawable == null) { return null; } if (drawable instanceof BitmapDrawable) { return ((BitmapDrawable) drawable).getBitmap(); } try { Bitmap bitmap; if (drawable instanceof ColorDrawable) { bitmap = Bitmap.createBitmap(COLO...
(id); FontMetrics fm = paint.getFontMetrics(); canvas.drawText(s, 0, 145 + fm.top - fm.ascent, paint); canvas.save(); Drawable drawableright = new BitmapDrawable(bitmap); drawableright.setBounds(0, 0, drawableright.getMinimumWidth(), drawableright.getMinimumHeight()); return drawable...
private Bitmap getBitmapFromDrawable(Drawable drawable) { if (drawable == null) { return null; } if (drawable instanceof BitmapDrawable) { return ((BitmapDrawable) drawable).getBitmap(); } try { Bitmap bitmap; if (drawable instanceof ColorDrawable) { bitmap = Bitmap.createBitmap(COLOR...