2

I'm trying to make an Evolus Pencil template for Android. My device has a 1.75x2.5625" screen, and I would like to emulate these exact physical dimensions. From reading this post: Android multiple screen sizes with same density I see Physical Size = Pixels / Density. So if I create an image that is 168px wide, on a 96dpi screen, should I not get a physical image of 168/96=1.75" wide?

Because I get one about 1.5" and I'm lost. I am running Ubuntu and confirmed my screen dpi with xdpyinfo as being 96x96. So what is a formula I can use for this? I was thinking one could get the pixels needed by multiplying the inches we want on the screen by the dpi of the screen, but this gives me the 168 mentioned above and obviously gets me no where.

Can anyone point me in the right direction, I'm honestly terrible with numbers and math so my apologies if I'm missing something simple or obvious.

Community
  • 1
  • 1
Anthony Hiscox
  • 435
  • 8
  • 17
  • 2
    you should accept more answers – bluefoot Mar 23 '11 at 01:34
  • [This](http://www.techwarelabs.com/articles/hardware/optical-vs-laser/images/dpi.jpg) would seem to confirm your formula. Are you sure your image isn't being scaled somehow without your knowledge? Another good way to check would be to compare with the resolution of the screen, e.g. a 480px wide screen at 96dpi should be exactly 5 inches wide. – Ozzah Mar 23 '11 at 01:41
  • @bluefoot, fair enough I'll go over them and see what I can accept. – Anthony Hiscox Mar 23 '11 at 01:48
  • @Ozzah, ok. xrandr reports 1024x576, so 1024/96 is 10.66" right? Mine is 8 3/4" wide... also that img you linked measures 1 1/4". In case it matters at all I'm running gnome with visual effects turned off.. – Anthony Hiscox Mar 23 '11 at 01:58
  • I just tried this on another computer and a 168px wide image is exactly the width of my android screen. So it's just this Lenovo s10e netbook, wonder if it's a video driver thing. – Anthony Hiscox Mar 23 '11 at 02:02

1 Answers1

2

Are you sure that the display is actually 96 ppi? Going by the specs, and my own calculations, your Lenovo S10e actually has a density of ~116.36 ppi, which is probably where your difference is coming in.

Assuming these specs are correct:
10.1" diagonal
1024 x 576 resolution
16:9 screen ratio (taken from above resolution)

Using some geometric formulas, you can get the actual width and height of the monitor as:

Width: 8.8"
Height: 4.95"

Dividing 1024/8.8 and 576/4.95 gives you 116.36 pixels per inch, rather than 96.

Using this instead, a 168 pixel image should display as 168/116.36, or ~1.44", which is consistent with your results. I wouldn't put too much faith in the xdpyinfo results. :)

Kevin Coppock
  • 133,643
  • 45
  • 263
  • 274
  • You are correct. When I use a dpi of 116.36 I get an image that is the correct physical size. Thank you for clearing that up for me. – Anthony Hiscox Mar 23 '11 at 06:28