mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-07-28 04:07:46 +00:00
api/media/ev3dev: add Image/screen save method
This was overlooked previously.
This commit is contained in:
@@ -176,6 +176,9 @@
|
||||
|
||||
.. autoattribute:: pybricks.hubs::EV3Brick.screen.height
|
||||
|
||||
.. automethod:: pybricks.hubs::EV3Brick.screen.save
|
||||
|
||||
|
||||
.. rubric:: Using the battery
|
||||
|
||||
.. automethod:: pybricks.hubs::EV3Brick.battery.voltage
|
||||
|
||||
+2
-1
@@ -306,5 +306,6 @@ with image files using the ``Image`` class given below.
|
||||
.. automethod:: pybricks.media.ev3dev.Image.load_image
|
||||
|
||||
|
||||
.. rubric:: Saving the image
|
||||
|
||||
|
||||
.. automethod:: pybricks.media.ev3dev.Image.save
|
||||
|
||||
@@ -218,6 +218,20 @@ class Image:
|
||||
There was a problem allocating a new image.
|
||||
"""
|
||||
|
||||
def save(self, filename):
|
||||
"""Saves |this image| as a ``.png`` file.
|
||||
|
||||
Arguments:
|
||||
filename (str):
|
||||
The path to the file to be saved.
|
||||
|
||||
Raises:
|
||||
TypeError:
|
||||
``filename`` is not a string.
|
||||
OSError:
|
||||
There was a problem saving the file.
|
||||
"""
|
||||
|
||||
|
||||
class Font:
|
||||
"""Object that represents a font for writing text."""
|
||||
|
||||
Reference in New Issue
Block a user