如何在位图上绘制文本?我做的:
float width = Converter.convertDpToPixel(250, context);
float height = Converter.convertDpToPixel(40, context);
Bitmap myBitmap = Bitmap.createBitmap((int)width + 1, (int)height+1, Bitmap.Config.ARGB_8888);
Canvas myCanvas = new Canvas(myBitmap);
Paint paint = new Paint();
Typeface tanger = Typeface.createFromAsset(context.getAssets(),"fonts/Tangerine_Bold.ttf");
paint.setAntiAlias(true);
paint.setSubpixelText(true);
paint.setTypeface(tanger);
paint.setStyle(Paint.Style.FILL);
paint.setColor(Color.BLACK);
paint.setTextSize(55);
paint.setTextAlign(Align.CENTER);
myCanvas.drawText(quote, 16, 60, paint);
return myBitmap;
但只显示部分文本,我不知道为什么。谢谢