我想创建一个包含一些字符串数据的Bitmap,然后将其发送到我的移动打印机。
我们怎么能这样做?
答案 0 :(得分:2)
尝试这样:
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