我有一个可绘制的。在写入可绘制文本之前,我想绕其中心旋转
drawable= this.getResources().getDrawable(R.drawable.image);
final int IMAGE_WIDTH = drawable.getIntrinsicWidth();
final int IMAGE_HEIGHT = drawable.getIntrinsicHeight();
Bitmap bitmap = Bitmap.createBitmap(IMAGE_WIDTH,
IMAGE_HEIGHT,
Bitmap.Config.ARGB_8888);
Canvas imageCanvas = new Canvas(bitmap);
Paint imagePaint = new Paint();
imagePaint.setTextAlign(Align.CENTER);
imagePaint.setTextSize(16f);
drawable.draw(imageCanvas);
imageCanvas.drawText("",
IMAGE_WIDTH / 2,
(IMAGE_HEIGHT - imagePaint.ascent()) / 2,
imagePaint);
LayerDrawable finalImage = new LayerDrawable(
new Drawable[]{drawable, new BitmapDrawable(bitmap)});