DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Camera Preview

06.30.2005
| 4586 views |
  • submit to reddit
        Taken (will some mod.) from 
http://discussion.forum.nokia.com/forum/showthread.php?s=&threadid=63464

pys60 (the full name is python for series 60) 1.1.3
provide both camera and graphics display.
So, it is trivial to take photo and preview.
from appuifw import *
import camera

canvas=Canvas()
app.body=canvas

running=1
def quit():
    global running
    running=0
app.exit_key_handler=quit

while running:
    image = camera.take_photo(size= (160,120))
    canvas.blit(image, target=(8, 12, 168, 132))  # center it
Here I use the small size (160x120) for preview.
When the real photo is taken I can use the full (defualt)
size of (640x480) on my 6600 phone.