i have made a canvas and draw an image on canvas i have also draw some text on
canvas. both the things image and text are now independent. i want that when i
draw text it should b printed on image. and i can save the image and text which is now
on image and i want to send image with text in another activity.
here is my code:
@Override
protected Void onDraw(Canvas canvas) {
Bitmap b = BitmapFactory.decodeResource(getResources(),R.drawable.ic);
canvas.drawBitmap(b,10,10,null);
canvas,drawText("hello this is my image",10,10,null);
}
@sachit. As you know in a real life, the Canvas is only a brush, that you can use to draw the on the paper. Here the paper is your image itself.
So don’t worry. Just send the Bitmap b, which is now the image with your text.
And for sending you can convert the b to bytearray
like
Now you can send the byteArray to another activity..
Cheers…….