Skip to content

Commit

Permalink
Merge pull request #28 from Jerry1962325/main
Browse files Browse the repository at this point in the history
method 'send_to_maixvision' should in object maix.dispaly
  • Loading branch information
Neutree committed Jul 3, 2024
2 parents 5e91226 + c13b559 commit 32ec1fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 7 additions & 3 deletions docs/doc/en/vision/display.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,17 @@ When running code in MaixVision, images can be displayed on MaixVision for easie

When calling the `show` method, the image will be automatically compressed and sent to MaixVision for display.

Of course, if you don't have a screen, or to save memory by not initializing the screen, you can also directly call the `send_to_maixvision` method of the `image.Image` object to send the image to MaixVision for display.
Of course, if you don't have a screen, or to save memory by not initializing the screen, you can also directly call the `send_to_maixvision` method of the `maix.display` object to send the image to MaixVision for display.
```python
from maix import image
from maix import image,display

from maix import image,display

img = image.Image(320, 240)
disp = display.Display()

img.draw_rect(0, 0, img.width(), img.height(), color=image.Color.from_rgb(255, 0, 0), thickness=-1)
img.draw_rect(10, 10, 100, 100, color=image.Color.from_rgb(255, 0, 0))
img.draw_string(10, 10, "Hello MaixPy!", color=image.Color.from_rgb(255, 255, 255))
img.send_to_maixvision()
display.send_to_maixvision(img)
```
8 changes: 5 additions & 3 deletions docs/doc/zh/vision/display.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,16 @@ disp.set_backlight(50)

在调用`show`方法时,会自动压缩图像并发送到 MaixVision 显示。

当然,如果你没有屏幕,或者为了节省内存不想初始化屏幕,也可以直接调用`image.Image`对象的`send_to_maixvision`方法发送图像到 MaixVision 显示。
当然,如果你没有屏幕,或者为了节省内存不想初始化屏幕,也可以直接调用`maix.dispaly`对象的`send_to_maixvision`方法发送图像到 MaixVision 显示。
```python
from maix import image
from maix import image,display

img = image.Image(320, 240)
disp = display.Display()

img.draw_rect(0, 0, img.width(), img.height(), color=image.Color.from_rgb(255, 0, 0), thickness=-1)
img.draw_rect(10, 10, 100, 100, color=image.Color.from_rgb(255, 0, 0))
img.draw_string(10, 10, "Hello MaixPy!", color=image.Color.from_rgb(255, 255, 255))
img.send_to_maixvision()
display.send_to_maixvision(img)
```

0 comments on commit 32ec1fd

Please sign in to comment.