brian.display
show_image
Loads a JPEG or PNG image from the SD card and displays it on screen instead of the running console.
Must be called while a MicroPython program is running.
Arguments:
path: Path to the image file on the SD card (e.g. "/images/logo.jpg").size: How the image is sized and positioned:"fullscreen_fit"— scaled to fit the full 320×240 screen while preserving aspect ratio (black background fills any empty space). Status bar is hidden."fullscreen_fill"— scaled to fill the full 320×240 screen while preserving aspect ratio (edges may be cropped to fill). Status bar is hidden."console"— scaled to fit within the console area, with margins and status bar visible; program file name and icon stay visible. Withoutback_button, the left+right interrupt/kill hint is shown as during a normal program run.back_button: If a non-empty string, a physical left back button with this label is displayed so the user can dismiss the image and return to the console view.Noneor""hides the button.
Raises:
OSError: If the image file cannot be found or decoded.ValueError: Ifsizeis not one of the accepted values.
clear_image
Clears the image currently shown by :func:show_image and returns to the console view.
No-op if no image is being displayed.
wait_until_image_closed
Blocks until the user dismisses the image with the back button.
Returns immediately if no image is displayed, or if the image has no back button
(see :func:show_image). Also returns once the image has been cleared (e.g. by :func:clear_image).
Raises KeyboardInterrupt if the program is interrupted while waiting (e.g. left+right buttons).