Get Picture Coordinates Regardless of ScreenSize
-
Hello there. I have written a code for 10" tablet with resolution of
2560 x 1600
and hardcoded values for it. The functionality is simple. I simply check whether current point on picture, in OnTouch event, lies in particular polygon or not. It works fine. But the problem is, I have hardcoded values and now I am given a 7" tablet with resolution of1200 x 1920
. And my code does not work for it because of changed resolution. How do I handle this? I don't want to hardcode another set of values for 7" tablet. Thanks NOTE: Picture resolution remains same1500 x 1501
pixels. -
Hello there. I have written a code for 10" tablet with resolution of
2560 x 1600
and hardcoded values for it. The functionality is simple. I simply check whether current point on picture, in OnTouch event, lies in particular polygon or not. It works fine. But the problem is, I have hardcoded values and now I am given a 7" tablet with resolution of1200 x 1920
. And my code does not work for it because of changed resolution. How do I handle this? I don't want to hardcode another set of values for 7" tablet. Thanks NOTE: Picture resolution remains same1500 x 1501
pixels.Django_Untaken wrote:
and hardcoded values for it
You should never do that. You should always get the screen dimensions from the underlying operating system, and adjust your code based on those values. android get screen size - Google Search[^]