EvertvdBraak
EvertvdBraak

Reputation: 1083

How to get Image width that has been scaled

enter image description here

I want to know the Actual image height and width as how it is being displayed on the screen. Can somebody help me?

i tried the following but it didn't gave me the results i was looking for

Upvotes: 6

Views: 717

Answers (1)

Zelter Ady
Zelter Ady

Reputation: 6348

You can try something like this:

  • you have Image height (IH) and image width (IW)
  • find ImageView height (H).
  • find the top padding (TP) and bottom padding (BP) for the ImageView
  • your displayed image height is DIH = H - (BP + TP)
  • displayed image width DIW = (IW * DIH) / IW;

I hope I understand your question.

Upvotes: 2

Related Questions