mShell Blog

25
Feb

Screen resolution independent programming

by Juerg

Since a few weeks I have a Nokia E90. This great phone has an external screen at standard S60 3rd Ed resolution of 240x320 pixels and an internal screen with 800x284 canvas size.

What a pitty when I started some of my scripts written earlier for the Nokia N70. Many of them has been written with the typical S60 2nd Ed screen resolution in mind so the app screen "hangs" somewhere in the upper left corner when running on a bigger screen. Although the script worked fine I had to go trough the code and change all constant screen coordinates or sizes to relative coordinates and sizes. All the time I saved with the quick hack to assume a constant screen size and/or orientation where eated up with the boring and time consuming adaptions for screen res. independency.

When programming for mobile phones you should always aware that screen size can be different from device to device. Also the screen orientation can change while your programm is updating the screen.

Use graph.size() to get the current screen resolution. If you are using icons (from files) it's a good idea to produce the graphics for a virtual screen resolution which should be at least  two times higher than the current standard. Before drawing the icons you can scale it with graph.size(icon, scale) or graph.size(icon, w, h).

For many applications it is also sufficient to to put the graph module in scaled mode. 

Whatever method you like better, make your application screen resolution independent!

Currently rated 3.0 by 2 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

m Programming

Powered by BlogEngine.NET 1.3.0.0


Calendar
<<  October 2008  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar
Archive
Authors
Tags
Categories

Sign in