×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Thumbs up How to know width and height of the screen

    Hi friends,

    I want to know the screen width and height?

    How to do this programmatically?

    Thanks,
    Manoj.

  2. #2
    Super Contributor
    Join Date
    Jul 2008
    Location
    Chennai,India
    Posts
    889

    Re: How to know width and height of the screen

    ClientRect()
    it will give the screen size of your appln...

  3. #3
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Re: How to know width and height of the screen

    Quote Originally Posted by deepchand86 View Post
    ClientRect()
    it will give the screen size of your appln...
    will it give like 240*320 for a mobile device which is having screen size 240*320?

    Thanks,
    Manoj.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,675

    Re: How to know width and height of the screen

    In case of GUI applications, ApplicationRect is even better, and especially CEikonEnv::ScreenDevice, then CWsScreenDevice::SizeInPixels for example.
    You may also succeed in creating CWsScreenDevice in GUI-less code, apparently you need a Window Server session for that.
    And HAL may also help you (like EDisplayXPixels and EDisplayYPixels).

  5. #5
    Super Contributor
    Join Date
    Jun 2008
    Posts
    593

    Smile Re: How to know width and height of the screen

    hi...

    u can get it from the Container Class...

    void LayoutControls()
    {
    // Print the Following 2 things..

    Rect().Width();
    Rect().Height();
    }

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,675

    Re: How to know width and height of the screen

    Well, the container class is exactly the one which does not know the size of the screen. That Rect is set via SetRect in construction-time. Setting it to 5,5-10,15 obviously will not cause your display to be 5x10 pixels large.

  7. #7
    Super Contributor
    Join Date
    Jun 2008
    Posts
    593

    Smile Re: How to know width and height of the screen

    Quote Originally Posted by wizard_hu_ View Post
    Well, the container class is exactly the one which does not know the size of the screen. That Rect is set via SetRect in construction-time. Setting it to 5,5-10,15 obviously will not cause your display to be 5x10 pixels large.
    If u try to get the size from the Draw Function,it wud return (0,0)

    but if u try to get it from LayOutControl as i suggested, it will give u the size of the Client-Area.. i have done the same..

  8. #8
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: How to know width and height of the screen

    AknLayoutUtils::LayoutMetricsRect will give you the sizes the current screen artifacts.
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

Similar Threads

  1. the camera issue,why the width and height changed
    By dengjian82 in forum Symbian
    Replies: 2
    Last Post: 2007-11-16, 01:31
  2. MMS browser width and height ??
    By cumminsj in forum General Messaging
    Replies: 0
    Last Post: 2007-03-14, 08:11
  3. Text size: height e width
    By oper6600 in forum Symbian
    Replies: 3
    Last Post: 2007-01-29, 09:30
  4. Replies: 7
    Last Post: 2006-09-01, 09:30

Posting Permissions

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