This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Take still pictures with Python | |
from picamera import PiCamera | |
from time import sleep | |
camera = PiCamera() | |
camera.rotation = 180 # You can rotate the image by 90, 180 or 270 degrees | |
camera.start_preview() # Make the camera preview | |
for i in range(5): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from svg import Parser, Rasterizer | |
def load_svg(filename, scale=None, size=None, clip_from=None, fit_to=None): | |
"""Returns Pygame Image object from rasterized SVG | |
If scale (float) is provided and is not None, image will be scaled. | |
If size (w, h tuple) is provided, the image will be clipped to specified size. | |
If clip_from (x, y tuple) is provided, the image will be clipped from specified point. | |
If fit_to (w, h tuple) is provided, image will be scaled to fit in specified rect. |