Android Adding Images Over ImageView
<p>I have a ImageView which shows a picture that has been taken from the camera. The effect i am trying to create is I want a image to appear over the ImageView with the OnTouchEvent. So say I have five images I am wanting it to have five OnTouchEvent's and for each touch on the screen a new image would appear over the top of the previouslly displayed image (they are transparent png's).</p>

<p>I have looked through this question <a href="http://stackoverflow.com/questions/5823680/adding-an-image-to-a-canvas-in-android">Adding an Image to a Canvas in Android</a> but can't get my head around it.</p>

<p>So basically I am wanting it so when you are viewing the Activity with the Image in the <code>ImageView</code> you can touch the screen which will then add a png over the top of the picture in the <code>ImageView</code> and so on for say 6 or 7 images. Each one gets added sepertaly so it would take 6 touchs of the screen to add 6 png's over the current Image in the <code>Imageview</code></p>

<p><strong>UPDATE Thanks to Graeme</strong></p>

<p>The code below has been updated I am just getting an error on <code>nextBitmap</code> which is <code>nextBitmap cannot be resolved</code> I think this is because I need to set this somewhere to go through the images that will be added like make an array?</p>

<p><strong>Update 2</strong></p>

<p>I now know that I need to some how add a string <code>nextBitmap</code> with the Images in so that it will loop throw them when the screen is touched, anyone got any ideas?</p>

<pre><code>public class BeatEmUp extends Activity {

Bitmap myBitmap;    

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.beatemup);

    String myRef = this.getIntent().getStringExtra("filepath");
    File imgFile = new  File(myRef);
    Log.e("No ref", myRef);

    if(imgFile.exists()) {
        final Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
        final ImageView myImage = (ImageView) findViewById(R.id.beatemup);
        myImage.setImageBitmap(myBitmap);
        myImage.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                myBitmap = getBitmapOverlay(myBitmap, nextBitmap, 0, 0);
                myImage.setImageBitmap(myBitmap);
            }
        });
    }
}

public static Bitmap getBitmapOverlay(Bitmap bmp1, Bitmap bmp2, int left, int top) {
    Bitmap bmOverlay = Bitmap.createBitmap(bmp1.getWidth(), bmp1.getHeight(),  bmp1.getConfig());
    Canvas canvas = new Canvas(bmOverlay);    
    canvas.drawBitmap(bmp1, 0, 0, null);
    canvas.drawBitmap(bmp2, left, top, null);
    return bmOverlay;
}
}
</code></pre>
