当前位置:网站首页>LVGL 8.2 Image
LVGL 8.2 Image
2022-06-30 10:08:00 【仙剑情缘】
创建Image
static void lv_example_img_1(void)
{
LV_IMG_DECLARE(img_cogwheel_argb); // img_cogwheel_argb图片资源声明
lv_obj_t* img1 = lv_img_create(lv_scr_act()); // 创建Image对象
lv_img_set_src(img1, &img_cogwheel_argb); // 设置图片资源为img_cogwheel_argb
lv_obj_align(img1, LV_ALIGN_CENTER, 0, -20); // LV_ALIGN_CENTER方式对齐
lv_obj_set_size(img1, 200, 200); // 设置大小
lv_obj_t* img2 = lv_img_create(lv_scr_act()); // 创建Image对象
lv_img_set_src(img2, LV_SYMBOL_OK "Accept"); // 设置图片资源为内部LV_SYMBOL_OK 符号和Accept字符显示
lv_obj_align_to(img2, img1, LV_ALIGN_OUT_BOTTOM_MID, 0, 20);//img2对齐img1的底部外框居中偏移0,20对齐
}
运行效果
将齿轮图片大小设置为100,100
clv_obj_set_size(img1, 100, 100); // 设置大小
运行效果
将齿轮图片大小设置为300,300
clv_obj_set_size(img1, 300, 300); // 设置大小
运行效果
边栏推荐
- WGet -- 404 not found due to spaces in URL
- Pytorch Notebook. Nn. Batchnorm1d
- 微信推出图片大爆炸功能;苹果自研 5G 芯片或已失败;微软解决导致 Edge 停止响应的 bug|极客头条...
- Turn to cartoon learning notes
- 机器学习面试准备(一)KNN
- Typescript – classes in Es5, inheritance, static methods
- Collectors.toMap应用
- 在 sCrypt 中实现高效的椭圆曲线点加法和乘法
- 19:00 p.m. tonight, knowledge empowerment phase 2 live broadcast - control panel interface design of openharmony smart home project
- 移植完整版RT-Thread到GD32F4XX(详细)
猜你喜欢
ArcGIS Pro scripting tool (5) - delete duplicates after sorting
无心剑中译狄金森《灵魂择其伴侣》
Mysql database foundation: constraint and identification columns
The performance of arm's new CPU has been improved by 22%, up to 12 cores can be combined, and the GPU is first equipped with hardware optical tracking. Netizen: the gap with apple is growing
【深度学习】深度学习检测小目标常用方法
Compétences Comb 27 @ Body sense Manipulator
scratch绘制正方形 电子学会图形化编程scratch等级考试二级真题和答案解析2022年6月
mysql数据库基础:约束、标识列
从0使用keil5软件仿真调试GD32F305
Using LVM to resize partitions
随机推荐
Pytorch Notebook. Nn. Batchnorm1d
Yixian e - commerce publie un rapport trimestriel: adhérer à la R & D et à l’investissement de la marque, réaliser un développement durable et de haute qualité
[rust daily] several new libraries were released on January 23, 2021
Leetcode question brushing (IV) -- greedy thought (go Implementation)
scratch绘制正方形 电子学会图形化编程scratch等级考试二级真题和答案解析2022年6月
My in-depth remote office experience | community essay solicitation
Didi open source agile test case management platform!
CSDN daily one practice 2021.11.06 question 1 (C language)
最新SCI影响因子公布:国产期刊最高破46分!网友:算是把IF玩明白了
吴恩达2022机器学习专项课测评来了!
Gd32 RT thread ota/bootloader driver function
Test memory read rate
Curl --- the request fails when the post request parameter is too long (more than 1024b)
05_Node js 文件管理模块 fs
技能梳理[email protected]基于51系列单片机的智能仪器教具
go-zero微服务实战系列(八、如何处理每秒上万次的下单请求)
【Rust每周一库】num-bigint - 大整数
Typescript – classes in Es5, inheritance, static methods
记一次实习的经历,趟坑必备(一)
在 sCrypt 中实现高效的椭圆曲线点加法和乘法