nevermind i got it working!
here is my code!
from picamera import PiCamera
camera = PiCamera()
camera.resolution = (1920, 1080)
app = App()
def preview():
camera.start_preview(fullscreen=False, window = (50,150,2048,1152))
button = PushButton(app, command=preview, text="preview")
def stop_preview():
camera.stop_preview()
button = PushButton(app, command=stop_preview, text="stop preview")
def shutter():
camera.capture('/home/pi/Desktop/image.jpg')
button = PushButton(app, command=shutter, text="shutter")
app.display()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…