Saturday, 15 February 2014

android - Select points on image to retrieve coordinates -


I'm trying (manually) select a section from an image and need to know the coordinates (square 4 digits)).

This is an Android app, I know that a crop is intended but does not really want to crop the section, just retrieve the coordinates of the four points of squared section.

Any thoughts?

Greatly appreciate!

Take the XY coordinate out by using the Java function like

  Public class extends MainActivity activity {@Override Build on Secure Zero (Bundle Saved Instantstate) {super.onCreate (savedInstanceState); SetContentView (R.layout.activity_main); ImageView imageView = (ImageView) findViewById (R.id.img); ImageView.setOnTouchListener (see new OnTouchListener) {@ Override Public Boolean On Touch (see V, Motion Event Event) {if (event.getAction () == MotionEvent.ACTION_DOWN} {// textView.setText ("Touch coordinates: "+ String.valueOf (event.getX ()) +" x "+ String.valueOf (event.getY ()); Log.e (" X ", String.valueOf (event.getX ())" ") ; Log.e ("y", String.valueOf (event.getY ()) + "");} true truth;}}); }}    

No comments:

Post a Comment