I have a 2.8 inch touch screen that plugs into the GPIO pins on my Raspberry Pi 3. https://www.adafruit.com/product/1601. I have a raspberry pi camera that I attached to the pi. I am using the start_ preview command and there aren't any errors. It doesn't seem to show the previews onto the touch screen and I do not have an extra monitor to connect to. It's there any way to display the previews on the touch screen?
I don't think this works as intended. At least, the docs for the Python picamera library state that:
The camera’s preview system directly overlays the Pi’s output on the HDMI or composite video ports. At this time, it will not operate with GPIO-driven displays like the PiTFT. Some projects, like the Adafruit Touchscreen Camera project, have approximated a preview by rapidly capturing unencoded images and displaying them on the PiTFT instead.
You can take a look at the relevant chunk of screen refreshing code for the Adafruit Touchscreen Camera project here on Adafruit's Github page:
# Refresh display if screenMode >= 3: # Viewfinder or settings modes stream = io.BytesIO() # Capture into in-memory stream camera.capture(stream, use_video_port=True, format='raw') stream.seek(0) stream.readinto(yuv) # stream -> YUV buffer stream.close() yuv2rgb.convert(yuv, rgb, sizeData[sizeMode], sizeData[sizeMode]) img = pygame.image.frombuffer(rgb[0: (sizeData[sizeMode] * sizeData[sizeMode] * 3)], sizeData[sizeMode], 'RGB') elif screenMode < 2: # Playback mode or delete confirmation img = scaled # Show last-loaded image else: # 'No Photos' mode img = None # You get nothing, good day sir