gilsaints88
gilsaints88

Reputation: 1160

How do I convert a pixel location (x and y coordinates) from one Android device to other Android devices?

How do I convert a pixel location (x and y coordinates) from one Android device to other Android devices with different screen size and different resolution?

Upvotes: 1

Views: 1739

Answers (1)

B. Nadolson
B. Nadolson

Reputation: 3068

One method: Divide x,y by the screen width and height resulting in a float from 0.0 to 1.0 and then multiply those 2 factors to 2nd device's screen width and height.

Upvotes: 4

Related Questions