title: How to get correct coords(event.getX() / event.getY()) of Object with OnTouchListener
body: <p>I have this :<br>
  <a href="https://i.stack.imgur.com/TfYWR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TfYWR.png" alt="source case"></a>  </p>
  
  <p>and what i want exactly is that to show portion of Bitmap via <strong>coords</strong>(X,Y) of object with OnTouchListener(orange <strong>square</strong> with dot in center).  </p>
  
  <p>So the problem is that i want to draw portion of image like it shows on image(Red square "<strong>Area that i want</strong>" to show).<br>
  So in this case,excepted result is(portion of bitmap) :<br>
  <a href="https://i.stack.imgur.com/SFX2F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SFX2F.png" alt="excepted result"></a><br>
  At current moment i'm doing like this:    </p>
  
  <pre><code>public boolean onTouch(View view, MotionEvent event) {
  
      switch (event.getAction()) {
          case MotionEvent.ACTION_MOVE:
  
              Bitmap mBitmap = Bitmap.createBitmap(sourceBitmap,view.getX() - view.getWidth(),view.getY()-view.getHeight(),250,250);
              //other stuff to fill this portion of bitmap
              break;
      }
  
      return true;
  }
  }
  </code></pre>
  
  <p>And it's not correct.</p>
  
  <p>how can i achieve this?
  Tried a lot of formulas,but no luck. Any suggestions?  </p>
  
  <p>PS As i understand <strong>event.getX()</strong>/<strong>event.getY()</strong> is getting relative coords(and it's not clear for me,what exactly coords getting from object of imageview with touch listener(orange square with dot in center),i mean its getting <strong>center</strong> of this objects or <strong>Top.Left</strong> corners(X,Y)) ?</p>