0

嗨,一个正在开发的绘图 android 应用程序。在那我想在位图中添加一个贴纸(图像)然后我可以保存图像..

请任何人知道这件事请ping我。提前致谢..

4

1 回答 1

2

类似的东西?将位图绘制到画布并绘制文本然后保存?

drawingCache = Bitmap.createBitmap(300, 400, Bitmap.Config.ARGB_8888);

Canvas canvas = new Canvas(drawingCache);
Paint paint = new Paint();

// Draw your bitmap to the canvas
canvas.drawBitmap(bitmap, 0, 0, paint);

Paint watermarkPaint = new Paint();
watermarkPaint.setColor(Color.WHITE);
watermarkPaint.setAlpha(150);
watermarkPaint.setTextSize(30);
watermarkPaint.setTextAlign(Paint.Align.LEFT);
watermarkPaint.setFlags(Paint.ANTI_ALIAS_FLAG);

canvas.drawText("Watermark", 100, 100, watermarkPaint);
于 2012-04-09T12:10:36.830 回答