Thank you phishboh! I never would have thought of doing that - for some reason I thought that import commands *had* to be at the top of the code.....although I noticed 'landscape' works, not 'portrait'.
Here's the (simple) code for a camera viewfinder that uses fullscreen, in the correct orientation (landscape / portrait etc). I haven't seen elsewhere a viewfinder example that uses fullscreen.
Note, you must include
Code:
appuifw.app.orientation='landscape'
before import camera.
You must also specify the image dimensions in
Code:
camera.start_finder(viewfinder,size = (320,240))
.
Finally, make sure when messing around with orientation settings that you exit python between changes - otherwise things can get screwed up when you quit and run script without exiting the interpreter.
Code:
import appuifw
appuifw.app.orientation='landscape' #THIS LINE MUST BE ABOVE IMPORT CAMERA
import camera, e32, random, graphics
def viewfinder(img):
#img.save(u'e:\\Python\\file.jpg')
canvas.blit(img)
def quit():
appuifw.app.orientation='automatic'
camera.stop_finder()
lock.signal()
appuifw.app.exit_key_handler = quit
appuifw.app.screen='full'
appuifw.app.body = canvas = appuifw.Canvas()
camera.start_finder(viewfinder,size = (320,240)) #YOU MUST SPECIFY (320,240), NOT (240,320)
lock = e32.Ao_lock()
lock.wait()