1

Hi every am new to this android development.

Currently am developing drawing application with adding stamps/labels to drawn image.so i have done drawing part so now i have to implement adding stamps/labels to that drawn image.

So please help me out this..

Quick learner
  • 699
  • 4
  • 22
  • 39

4 Answers4

4
Bitmap Rbitmap = Bitmap.createBitmap(bitmap).copy(Config.ARGB_4444, true);
Canvas canvas = new Canvas(Rbitmap);            
canvas.drawBitmap(label, -9, Rbitmap.getHeight()-label.getHeight()-10, null);
canvas.save();
return Rbitmap;

Making your question little more specific will help you more.If I understood is correct this piece of code will help you out to draw a bitmap to a drawn canvas.

Sreedev
  • 6,563
  • 5
  • 43
  • 66
0

You could be a little more specific, i.e posting some code to show what you have to get more specific answers. Anyway, you can draw a bitmap on top of another bitmap by using something like this:

//You will have a Bitmap bottomBmp, a Bitmap topBmp and a Canvas canvas.
//If you are inside an onDraw() method the canvas will be provided to you, otherwise you will have to create it yourself, use a mutable bitmap of the same size as the bottomBmp.

canvas.drawBitmap(bottomBmp, 0, 0, null); //Draw the bottom bitmap in the upper left corner of the canvas without any special paint effects.
canvas.drawBitmap(topBmp, 0, 0, null); //Draw the top bitmap over the bottom bitmap, change the zeroes to offset this bitmap.
Jave
  • 31,598
  • 14
  • 77
  • 90
0

private Paint green = new Paint();

private int greenx , greeny;

green.setColor(Color.GREEN);

    green.setAntiAlias(false);

    canvas.drawCircle(greenx,greeny,20,green);

how to add image in this code replace drawcircle with image how ?

Aqif
  • 326
  • 3
  • 5
-1

Try with this code:

private Bitmap background;

public birdClass(Context context) {
    super(context);
    background = BitmapFactory.decodeResource(getResources(),R.drawable.splash );
}
B. Go
  • 1,436
  • 4
  • 15
  • 22
Aqif
  • 326
  • 3
  • 5