Hezhou Air724UG LuatOS-Air LVGL API control-Screenshots

Screenshots

Share and export pdf

undefined


For screenshot function, the core version number must be >=3211

Sample code

    -- 创建图片控件
    img = lvgl.img_create(lvgl.scr_act(), nil)
    -- 设置图片显示的图像
    lvgl.img_set_src(img, "/lua/test.png")
    -- 图片居中
    lvgl.obj_align(img, nil, lvgl.ALIGN_CENTER, 0, 0)
    --文件路径名只支持bmp
    local name = "/sdcard0/1.bmp"
    -- 截屏
    local ret =disp.screenshots(name, 200, 300, 400, 500)

API

disp.screenshots

transfer disp.screenshots(name, x1, x2, y1, y2)
Function Capture a picture of a specified area of ​​the display screen
return 0/-1 success/failure
parameter
name File path name only supports bmp
x1 Horizontal initial value MIPI screen (0-479)/LCD screen (0-239)
x2 Horizontal end value MIPI screen (x1-479)/LCD screen (x1-239)
y1 Vertical initial value MIPI screen (0-853)/LCD screen (0-320)
y2 Vertical end value MIPI screen (y1-853)/LCD screen (y1-321)

Screenshot effect

See the sample code above for screenshot coordinates. The image is saved to the SD card and a virtual USB flash drive is displayed on the computer.

undefined

Test firmware versions and scripts

LuatOS-Air_V3211_RDA8910_RFTLLMPMSPBSDZZ_0xd0000.pac
screenshots.7z

Version customization

For LuatOS-Air versions greater than or equal to V3211, you need to go to the customized firmware web page to generate customized firmware with PB function. Customized firmware address: Customized firmware

Guess you like

Origin blog.csdn.net/l531798151/article/details/132794920