×
Namespaces

Variants
Actions

Archived:How to use the camera viewfinder in PySymbian

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Tested with
Devices(s): Nokia N95, Nokia E90
Compatibility
Platform(s): S60 2nd Edition, S60 3rd Edition
Article
Keywords: camera
Created: lfd (15 May 2007)
Last edited: hamishwillee (31 May 2013)

Contents

Overview

This snippet shows how to use the camera viewfinder in Python.

Preconditions

Note: The camera module is not available for S60 1st Edition.

Source code

import appuifw, e32, camera
 
 
app_lock = e32.Ao_lock()
#Define the exit function
def quit():
#Close the viewfinder
camera.stop_finder()
#Release the camera so that other programs can use it
camera.release()
app_lock.signal()
appuifw.app.exit_key_handler = quit
 
#Function for displaying the viewfinder
def vf(im):
appuifw.app.body.blit(im)
 
#Set the application's body to Canvas
appuifw.app.body = appuifw.Canvas()
 
#Start the viewfinder and keep the backlight on
camera.start_finder(vf, backlight_on = 1)
 
#Wait for the user to request the exit
app_lock.wait()

Postconditions

The viewfinder is shown on the device's screen and the backlight is kept on.

This page was last modified on 31 May 2013, at 04:09.
71 page views in the last 30 days.
×