Archived:How to use the camera viewfinder in PySymbian
This snippet shows how to use the camera viewfinder in Python.
Note: The camera module is not available for S60 1st Edition.
import appuifw, e32, camera
app_lock = e32.Ao_lock()
#Define the exit function
#Close the viewfinder
#Release the camera so that other programs can use it
appuifw.app.exit_key_handler = quit
#Function for displaying the viewfinder
#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
The viewfinder is shown on the device's screen and the backlight is kept on.