MikeOrtiz / TouchImageView

Adds touch functionality to Android ImageView.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Correct cropping params

emartynov opened this issue · comments

Hi people,

I'm implementing cropping. So I need the original image size.

As for now I use drawable.intrinsicWidth, drawable.intrinsicHeight and zoomedRect.

However, I saw in source code that image can be rotated and I'm not sure that zoomedRect returns correct data if not zoomed.

Oke, zoomedRect question is clear - it returns bogus if the image is not zoomed.

But would be great to get some rectangle when the image is centred to fill image view and not zoomed.

Something like a visible rectangle.

If it's missing, I'm happy to approve any contribution

Clear, let me implement it and contribute :)

So the algorithm is next:

  1. if the image is zoomed take zoomedRect
  2. else take drawable intrinsics apply scroll and find an intersection with view size

Or I need also apply scroll for zoomedRect?

Correct?

You spent more time with this questions, and it sounds smart to reflect on scroll the zoomedRect

Super nice would be an Activity to demonstrate the working implementation here
image

commented

This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!