From 9a123376ff0e8e819a58227f75a868599c08c270 Mon Sep 17 00:00:00 2001 From: Neucrack Date: Fri, 12 Apr 2024 20:04:23 +0800 Subject: [PATCH] optimize image constructor --- components/maix/include/convert_image.hpp | 2 +- docs/doc/zh/vision/display.md | 9 +++++++++ examples/communication/serial/comm_uart.py | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/components/maix/include/convert_image.hpp b/components/maix/include/convert_image.hpp index 99b69013..a3d0b1c3 100644 --- a/components/maix/include/convert_image.hpp +++ b/components/maix/include/convert_image.hpp @@ -61,7 +61,7 @@ namespace maix::image } else { - img = new image::Image(mat.cols, mat.rows, fmt, mat.data); + img = new image::Image(mat.cols, mat.rows, fmt, mat.data, -1, false); } return img; } diff --git a/docs/doc/zh/vision/display.md b/docs/doc/zh/vision/display.md index fb3ce5af..cf13a339 100644 --- a/docs/doc/zh/vision/display.md +++ b/docs/doc/zh/vision/display.md @@ -72,6 +72,15 @@ while not app.need_exit(): > 这里用了一个`while not app.need_exit():` 是方便程序在其它地方调用`app.set_exit_flag()`方法后退出循环。 +## 调整背光亮度 + +在系统的`设置`应用中可以手动调整背光亮度,如果你想在程序中调整背光亮度,可以使用`set_backlight`方法,参数就是亮度百分比,取值范围是 0-100: +```python +disp.set_backlight(50) +``` + +注意,程序退出回到应用选择界面后会自动恢复到系统设置的背光亮度。 + ## 显示到 MaixVision diff --git a/examples/communication/serial/comm_uart.py b/examples/communication/serial/comm_uart.py index db428901..7c6c4cd5 100644 --- a/examples/communication/serial/comm_uart.py +++ b/examples/communication/serial/comm_uart.py @@ -2,7 +2,7 @@ from maix import app, uart import sys -ports = uart.list_ports() +ports = uart.list_devices() if len(ports) == 0: print("no port found")