Drawing a Circle with One Inch Diameter on All Res

Monkey Forums/Monkey Programming/Drawing a Circle with One Inch Diameter on All Res

c.k.(Posted 2012) [#1]
I want to draw a circle of one inch in diameter for all platforms/devices/resolutions.

Anybody have a clue as to how to do that?

I'm thinking there might be way too many variables to be able to guarantee that the circle will have a one inch diameter on all platforms/devices/resolutions. But it has to be possible! :-)


Jesse(Posted 2012) [#2]
there is no guarantee because you would need to know the size of the monitor and the pixels per inch per resolution. I am pretty sure is impossible for most monitors.


c.k.(Posted 2012) [#3]
Ah! That's it! I wonder if the pixels per inch value is available from most devices. Anybody know?


chimaera(Posted 2012) [#4]
Well, the data can be found. The easy data is for the iOS mobile devices but it is CRAZY for the android mobile devices unfortunately as there is no set standard. And as Jesse said. You will never be able to find out the actual physical size of the monitor/screen.


Rone(Posted 2012) [#5]
Maybe this helps for android

http://developer.android.com/reference/android/util/DisplayMetrics.html
http://developer.android.com/reference/android/util/DisplayMetrics.html#density
http://developer.android.com/guide/practices/screens_support.html

DisplayMetrics.density:

The logical density of the display. This is a scaling factor for the Density Independent Pixel unit, where one DIP is one pixel on an approximately 160 dpi screen (for example a 240x320, 1.5"x2" screen), providing the baseline of the system's display. Thus on a 160dpi screen this density value will be 1; on a 120 dpi screen it would be .75; etc.

This value does not exactly follow the real screen size (as given by xdpi and ydpi, but rather is used to scale the size of the overall UI in steps based on gross changes in the display dpi. For example, a 240x320 screen will have a density of 1 even if its width is 1.8", 1.3", etc. However, if the screen resolution is increased to 320x480 but the screen size remained 1.5"x2" then the density would be increased (probably to 1.5).