Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. Get Picture Coordinates Regardless of ScreenSize

Get Picture Coordinates Regardless of ScreenSize

Scheduled Pinned Locked Moved Android
questionmobilehelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Django_Untaken
    wrote on last edited by
    #1

    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 of 1200 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 same 1500 x 1501 pixels.

    L 1 Reply Last reply
    0
    • D Django_Untaken

      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 of 1200 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 same 1500 x 1501 pixels.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups