Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Archived:How to take a photo in m programming language on Symbian

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

M on Symbian is not maintained and may not run on current Symbian versions. All M articles have been archived.

Article Metadata
Tested with
Devices(s): Nokia N95, Nokia E90
Platform(s): S60 2nd Edition, S60 3rd Edition, S60 5th Edition
S60 5th Edition
Platform Security
Capabilities: )
Created: bogdan.galiceanu (05 May 2009)
Last edited: hamishwillee (09 May 2013)



This snippet shows how to take a photograph in m.


Note: The take function of the cam module requires Write permission if given a file path as an argument.

Images can be saved in JPEG, BMP, GIF or PNG format.

Source code

use cam, graph, ui
//Activate the camera with one of the supported resolutions
//Set the camera's brightness to slightly above normal and lower the contrast
//Display the viewfinder
cam.view(0, 0, graph.full()[0], graph.full()[1])
//Set the menu and wait for the user to select the option"Options", ["Take photo"], false)
if ui.cmd() = "Take photo" then
//Take a picture and save it at highest quality
img = cam.take("C:\\picture.jpg", 100)
//Deactivate the camera


A photograph will be taken with the given settings and stored at the given path.

Additional information

  • The available resolutions can be found using the sizes function.
  • The number of cameras available on a device can be found using the count constant.
  • If a device has multiple cameras, the camera to be used is set using the index function that takes the camera's index as an argument.
  • On some devices, maximum resolution might only be available in landscape mode.
This page was last modified on 9 May 2013, at 02:46.
36 page views in the last 30 days.