I have a program in which I would like to place an image at the coordinates of a touch event. I have the coordinates now I just need help with placing an image there. I will be using a drawable.
Edit** I also want to overlay it over another image. I cant find any documentation on this what so ever. I would think it should be easy.
Can anyone help me?
EDIT** Got it, now I just have to figure out how to get the middle of the image at the touch spot and not the top left corner:
final View touchView2 = findViewById(R.id.ImageView02);
touchView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
Log.v("x,y",event.getY()+","+event.getX());
touchView2.bringToFront();
int y = (int)event.getY();
int x = (int)event.getX();
touchView2.layout(x, y, x+48, y+48);
return true;
}
});