api/media/ev3dev: add Image/screen save method

This was overlooked previously.
This commit is contained in:
David Lechner
2020-03-06 12:59:42 -06:00
parent d97b15c23d
commit cab16f6af7
3 changed files with 19 additions and 1 deletions
+3
View File
@@ -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
View File
@@ -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
+14
View File
@@ -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."""