Reputation: 157
I would like to add the text to be part of my image. Eg. Date and time, or "You are using the Free version". Is it possible....? Please help me. Thanks in advance.
Upvotes: 0
Views: 272
Reputation: 157
Thanks Gabriel for the right direction: Following code helped me.
public static Bitmap WaterMark(Bitmap src, String watermark,int x, int y, int size) {
int w = src.getWidth();
int h = src.getHeight();
// TML_Library.Debug("Image Width = "+w+" Image Height = "+h);
Bitmap result = Bitmap.createBitmap(w, h, src.getConfig());
Canvas canvas = new Canvas(result);
canvas.drawBitmap(src, 0, 0, null);
Paint paint = new Paint();
paint.setTextSize(size);
paint.setColor(Color.rgb(255, 0, 0));
paint.setAntiAlias(true);
canvas.drawText(watermark, x, y, paint);
return result;
}
Upvotes: 0