# Thread: how to find dpi or ppi

1. ## how to find dpi or ppi

How to find ppi (pixel per inch) or dpi or pixel density in Series 60. Is there an API or calculation?

I know how to get pixel and twip dimensions but not the density.

3. ## Re: how to find dpi or ppi

Thanks for the response,

Could we fetch diagonal size of screen in inches using any OS api?

4. ## Re: how to find dpi or ppi

If you apply CWsScreenDevice::Horizontal/VerticalPixelsToTwips (assuming that they are actually working) to the whole screen, Mr. Pythagoras will be able to help you (http://en.wikipedia.org/wiki/Pythagorean_theorem)

5. ## Re: how to find dpi or ppi

hi wizard_hu,

i am not sure how CWsScreenDevice::Horizontal/VerticalPixelsToTwips will help. As far as i understand, for both Nokia N97 and Noki 5800, horizontal and vertical pixels would be the same as (360 / 640).

regards
Naveen

6. ## Re: how to find dpi or ppi

Originally Posted by pncbose
i am not sure how CWsScreenDevice::Horizontal/VerticalPixelsToTwips will help. As far as i understand, for both Nokia N97 and Noki 5800, horizontal and vertical pixels would be the same as (360 / 640).
That is why I suggested converting pixels to twips. 1440 twips are 1 inch. It is the measurement unit for physical dimensions used by Symbian. The methods will not necessarily work, but if you do not even try them that definitely will not help.

7. ## Re: how to find dpi or ppi

I am doing the following:
TSize screenSize = CEikonEnv::Static()->ScreenDevice()->SizeInPixels();
TSize twipsSize = CEikonEnv::Static()->ScreenDevice()->SizeInTwips();
TInt horizontalTwips = CEikonEnv::Static()->ScreenDevice()->HorizontalPixelsToTwips(screenSize.iWidth);
TInt verticalTwips = CEikonEnv::Static()->ScreenDevice()->VerticalPixelsToTwips(screenSize.iHeight);

For both Nokia 5800 and N97 i am getting the same values:
screenSize = (360, 640)
twipsSize = (2235, 3973)
horizontaltwips = 2235
verticaltwips = 3973

I am hoping to get a value which i could extrapolate to the dimension of 3.5" for N97 or 3.2" for 5800.

Correct me if i am wrong.

8. ## Re: how to find dpi or ppi

Simply putting it, i am looking at finding out how big the screen is in inches

9. ## Re: how to find dpi or ppi

Have you really done the related maths?
sqrt(sqr(2235),sqr(3973)) is 4558.5, which means 3.17 inches, approximately 3.2, as expected in case of the 5800. Apparently the N97 has some bug in its firmware (or perhaps a better guess: they have simply forgotten modifying the values when creating the N97 - since the 5800 was the earlier device). You can try reporting it in some Feedback boards.
Personally I could also imagine living with this precision. For approximating the physical size of objects the user sees on the display, it is enough.

10. ## Re: how to find dpi or ppi

hi wizard_hu,

Yup, i have done the calculations for both n97 and 5800 and i am exactly talking about the incorrect value of N97 (3.2 when i am expecting 3.5). Also i have found the same deviation for Nokia N85 (getting 2.4 instead of 2.6).

The reason i am looking for a better method is that - i have found 2 devices giving incorrect values out of a sample of 7. Not sure how many other devices will give this incorrect value.

Please suggest me which feedback forum to report this problem for proper notice and response

11. ## Re: how to find dpi or ppi

Perhaps it could be reported as S60 platform-related feedback in http://discussion.forum.nokia.com/fo...play.php?f=115

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•