×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50

    Question 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.

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Posts
    1,009

    Re: how to find dpi or ppi

    Regards,
    Shafali

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50

    Question 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. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    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. #5
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50

    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. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: how to find dpi or ppi

    Quote Originally Posted by pncbose View Post
    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. #7
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50

    Question 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. #8
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50

    Question Re: how to find dpi or ppi

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

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    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. #10
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    50

    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. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    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

Similar Threads

  1. Emulator: Can't find class file. Error
    By linlearn in forum Mobile Java Tools & SDKs
    Replies: 6
    Last Post: 2007-03-05, 12:20
  2. How to use Find box!
    By ctpthanh in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-03-12, 10:37
  3. list box example
    By murmur20 in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-11-09, 04:42
  4. list box with find box - Series 60
    By white_dragon in forum Symbian
    Replies: 3
    Last Post: 2004-08-16, 09:52
  5. Replies: 0
    Last Post: 2003-02-27, 20:28

Posting Permissions

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