I want to make something(for example an arrow) appear on a picture. The location of this arrow depends on the value in a variable. How do I make this in Android? If possible, I need it to be screensize-independent and also support zooming in. Thanks!
Asked
Active
Viewed 111 times
0
-
http://stackoverflow.com/questions/6023549/android-how-to-get-the-image-edge-x-y-position-inside-imageview – John Feb 11 '14 at 12:24
-
What have you tried? You'll be much more likely to get a response if you include your own attempts at solving your problem. – Hecksa Feb 11 '14 at 12:46
1 Answers
0
To draw an image at a specific place you should change its margins values:
MarginLayoutParams params= (MarginLayoutParams)getLayoutParams();
params.setMargins((int) Math.round(location.x - (_width / 2.0)),
(int)Math.round(location.y - (_height / 2.0)), 0, 0);
requestLayout();
width and height are you image dimensions.

Evgeni Roitburg
- 1,958
- 21
- 33