×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    247

    enumeration of verious possible sizes?

    Hi,

    I wanted to know, if it feasible to find out the various possible sizes (layouts) of a device using some APIs.
    e.g.
    E71 - 320x240
    N96 - 320x240, 240x320.

    Actually, presently I am keeping all assets in my application at the start of it (Must to do). But if i could figure out the scenarios as for E71, i will never load the assets for unused sizes.

    so please let me know the way to enumerate teh possible sizes of devices for 3rd and 5th Ed devices.

    Thanks in advace.
    - jupitar

  2. #2
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    103

    Smile Re: enumeration of verious possible sizes?

    Quote Originally Posted by jupitar View Post
    Hi,

    I wanted to know, if it feasible to find out the various possible sizes (layouts) of a device using some APIs.
    e.g.
    E71 - 320x240
    N96 - 320x240, 240x320.

    Actually, presently I am keeping all assets in my application at the start of it (Must to do). But if i could figure out the scenarios as for E71, i will never load the assets for unused sizes.

    so please let me know the way to enumerate teh possible sizes of devices for 3rd and 5th Ed devices.

    Thanks in advace.
    - jupitar
    you can try to use the following codes to get the current size of the screen:

    codes
    CWsScreenDevice* screenDevice = CEikonEnv::Static()->ScreenDevice();
    const TSize& screenSize = screenDevice->SizeInPixels();
    screenSize.iWidth // the width of current screen
    screenSize.iHeight // the highth of current screen

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    282

    Re: enumeration of verious possible sizes?

    I got this code from somewhere which i regularly use to iterate all the supported screen sizes on a device. You can try if it suites you.

    Code:
    	RWsSession session;
    	User::LeaveIfError(session.Connect());
    	CWsScreenDevice *screendevice=new (ELeave)CWsScreenDevice(session);
    	User::LeaveIfError(screendevice->Construct());
    	console->Printf(_L("Num Screeen Modes:%d\n"),screendevice->NumScreenModes());
    	TInt nummodes=screendevice->NumScreenModes();
    	for(TInt i=0;i<nummodes;++i)
    		{
    		TPixelsTwipsAndRotation rotation;
    		screendevice->GetScreenModeSizeAndRotation(i,rotation);
    		console->Printf(_L("Rotation: %d  Size:%dx%d\n"),rotation.iRotation,rotation.iPixelSize.iWidth,rotation.iPixelSize.iHeight);
    		}
    	delete screendevice;
    	session.Close();

    Hope that helps,
    VJ

Similar Threads

  1. error PRJ0019 error while creating sis file
    By mrshine in forum Symbian
    Replies: 3
    Last Post: 2008-10-17, 17:16
  2. Problem enumerating camera sizes on N95
    By rvogt in forum Symbian Media (Closed)
    Replies: 10
    Last Post: 2007-11-29, 22:53
  3. Conflicting stack sizes - again!
    By schm1 in forum Mobile Java General
    Replies: 7
    Last Post: 2005-10-08, 12:09
  4. Font sizes
    By civax in forum Mobile Java General
    Replies: 1
    Last Post: 2004-09-21, 05:00
  5. Recommended Sizes for MMS Image, Text and Layout
    By sguthery in forum General Messaging
    Replies: 3
    Last Post: 2003-08-22, 09:10

Posting Permissions

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