我试图通过画布绘制文字和绘制位图,我想只旋转文字,但整个画布旋转,任何想法?
Bitmap.Config conf = Bitmap.Config.ARGB_8888;
Bitmap bmp = Bitmap.createBitmap(100, 100, conf);
Canvas c = new Canvas(bmp);
Paint color = new Paint();
color.setTextSize(35);
color.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD));
color.setColor(Color.BLUE);
canvas.drawBitmap(drawable.getBitmap, 0, 0, null);
canvas.drawText("Test", 30, 30, color);
return bmp;
我有谷歌地图和标记方法setRotation旋转bmp
答案 0 :(得分:0)
您希望在将转化应用于canvas.save()
之前致电Canvas
。完成绘制文字后,请致电canvas.restore()
。致电restore()
会将Canvas
返回到您拨打save()
时的状态。