当前位置:网站首页>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); // 设置大小
运行效果

边栏推荐
- Arm新CPU性能提升22%,最高可组合12核,GPU首配硬件光追,网友:跟苹果的差距越来越大了...
- 从0使用keil5软件仿真调试GD32F305
- "Hackers and painters" -- why not be stupid
- Leetcode question brushing (II) -- sorting (go Implementation)
- Leetcode question brushing (III) -- binary search (go Implementation)
- Go -- standard library sort package
- 苹果高管公然“开怼”:三星抄袭 iPhone,只加了个大屏
- Gd32 RT thread flash driver function
- R language plot visualization: use plot to visualize the prediction confidence of the multi classification model, the prediction confidence of each data point of the model in the 2D grid, and the conf
- Circuit breaker hystrixcircuitbreaker
猜你喜欢

How to deploy deflationary combustion destruction contract code in BSC chain_ Deploy dividend and marketing wallet contract code

Yixian e-commerce released its first quarterly report: adhere to R & D and brand investment to achieve sustainable and high-quality development
[email protected]语音模块+stm32+nfc"/>技能梳理[email protected]语音模块+stm32+nfc

今晚19:00知识赋能第2期直播丨OpenHarmony智能家居项目之控制面板界面设计

智能DNA分子纳米机器人模型来了

mysql数据库基础:视图、变量

Q-Learning笔记

Arm新CPU性能提升22%,最高可组合12核,GPU首配硬件光追,网友:跟苹果的差距越来越大了...

逸仙電商發布一季報:堅持研發及品牌投入,實現可持續高質量發展

Android 开发面试真题进阶版(附答案解析)
随机推荐
【Rust日报】2021-01-22 首份Rust月刊杂志邀请大家一起参与
ArcGIS Pro脚本工具(6)——修复CAD图层数据源
Yixian e-commerce released its first quarterly report: adhere to R & D and brand investment to achieve sustainable and high-quality development
CVPR 2022 | 清华&字节&京东提出BrT:用于视觉和点云3D目标检测的桥接Transformer
今晚19:00知识赋能第2期直播丨OpenHarmony智能家居项目之控制面板界面设计
Gd32 RT thread DAC driver function
Pandora IOT development board learning (HAL Library) - Experiment 1 running lantern (RGB) experiment (learning notes)
我的远程办公深度体验 | 社区征文
半钢同轴射频线的史密斯圆图查看和网络分析仪E5071C的射频线匹配校准
CSDN blog operation team 2022 H1 summary
ArcGIS Pro scripting tool (5) - delete duplicates after sorting
Typescript – classes in Es5, inheritance, static methods
Circuit breaker hystrixcircuitbreaker
透过华为军团看科技之变(五):智慧园区
Skill combing [email protected] voice module +stm32+nfc
ArcGIS PRO + PS vectorized land use planning map
Criu enables hot migration
【Rust每周一库】num-bigint - 大整数
Viewing technological changes through Huawei Corps (V): smart Park
[rust daily] several new libraries were released on January 23, 2021