我试图在位图上绘制文本,然后返回更改后的位图
public Bitmap applyHeadline(Bitmap image)
{
alteredImages = image;
Paint paint = new Paint();
paint.setColor(Color.BLACK);
paint.setStyle(Paint.Style.FILL);
Bitmap tempBitmap = Bitmap.createBitmap(alteredImages.getWidth(),alteredImages.getHeight(), Bitmap.Config.RGB_565);
Canvas tempCanvas = new Canvas(tempBitmap);
tempCanvas.drawPaint(paint);
paint.setTextSize(size);
tempCanvas.drawBitmap(alteredImages, 0, 0, null);
tempCanvas.drawText("test", 0, 0, paint);
return tempBitmap;
}
但是,图像上没有任何改变。我对java和android一般都很新,所以很抱歉提前成为一个白痴。任何帮助将不胜感激。