×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    50

    Screen Size And Rotation on nokia n95 8GB

    Hi,

    I'm trying to identify the screen mode (landscape/protrait).

    I tried the following code:

    1.
    TSizeMode sizeMode = iScreenDevice->GetCurrentScreenModeAttributes();
    return sizeMode.iRotation;

    2.
    TInt aMode = iScreenDevice->CurrentScreenMode();
    TPixelsAndRotation aScreenMode;
    iScreenDevice->GetScreenModeSizeAndRotation(aMode, aScreenMode);
    return aScreenMode.iRotation;

    When I use it on on N73, 6120, N95 4GB I get CFbsBitGc::EGraphicsOrientationNormal when the screen is on portrait

    But when I use it on N95 8GB I get CFbsBitGc::EGraphicsOrientationNormal when the screen is on landscape.

    Any ideas?

  2. #2
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    50

    Thumbs up Re: Screen Size And Rotation on nokia n95 8GB

    Solved it!

    I used:
    if (aScreenMode.iPixelSize.iHeight == 320)...

    instead of aScreenMode.iRotation

  3. #3
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    50

    Talking Re: Screen Size And Rotation on nokia n95 8GB

    Thanks a lot!

    I've been a great help to myself...

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Screen Size And Rotation on nokia n95 8GB

    i suggest not using hard coded values

    Code:
    TRect myScreenRect;
    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, myScreenRect);
    if(myScreenRect.Height() < myScreenRect.Width())
        {
        //Orientation is Landscape
        }
    else if(myScreenRect.Width() < myScreenRect.Height())
        {
        // Orientation is Portrait
        }
    else
        {
        // Unknown
        }

Similar Threads

  1. Screen Rotation on N95
    By dmunsie in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-06-02, 17:09
  2. Ccamera rotation and N80 picture size
    By ynho in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2006-12-29, 01:06
  3. Emulator screen size configuration and rotation
    By greatape in forum Symbian C++
    Replies: 0
    Last Post: 2006-03-01, 11:25

Posting Permissions

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