Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor pinhassi's Avatar
    Join Date
    Dec 2007
    Posts
    50
    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 pinhassi's Avatar
    Join Date
    Dec 2007
    Posts
    50
    Solved it!

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

    instead of aScreenMode.iRotation

  3. #3
    Regular Contributor pinhassi's Avatar
    Join Date
    Dec 2007
    Posts
    50
    Thanks a lot!

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

  4. #4
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved