You Are Here:

Community: Wiki

This page was last modified on 5 May 2009, at 12:38.

How to take a photo in m

From Forum Nokia Wiki


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

Overview

This snippet shows how to take a photograph in m.

Preconditions

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
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()

Postconditions

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.

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fHowE5ftoE5ftakeE5faE5fphotoE5finE5fmX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZmediaQ qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxs60X qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ