Amit
Amit

Reputation: 381

onclick on canvas android

I wanted touch event on every bitmap drawn using canvas

canvas.drawBitmap(bitmap, points.get(i).x, points.get(i).y, null);

any help is appreciated

Kind regards

Upvotes: 3

Views: 2102

Answers (1)

Shailendra Singh Rajawat
Shailendra Singh Rajawat

Reputation: 8242

  • implement onTouchListener.
  • inside constructor > setOnTouchListener(this)
  • you have coordinates of all bitmaps, so inside onTouchListener get X,Y coordinates and compare with bitmap coordinates and take action accordingly.

Upvotes: 3

Related Questions