试试这样:
Bitmap resultBitmap = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(resultBitmap);
Paint paint = new Paint();
paint.setColor(Color.RED);
canvas.drawText("", 10, 10, paint);
//here you can return that bitmap directly