| ID | Creation date | May 5, 2009 | |
| Platform | S60 2nd Edition, S60 3rd Edition, S60 5th Edition | Tested on devices | Nokia N95, Nokia E90 |
| Category | M | Subcategory | Imaging |
| Keywords (APIs, classes, methods, functions): cam |
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.
use cam, graph, ui
//Activate the camera with one of the supported resolutions
cam.on(0)
//Set the camera's brightness to slightly above normal and lower the contrast
cam.bright(15)
cam.contrast(-10)
//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
ui.menu("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)
end
//Deactivate the camera
cam.off()
A photograph will be taken with the given settings and stored at the given path.
No related wiki articles found