当前位置:网站首页>LVGL 8.2 Image styling and offset
LVGL 8.2 Image styling and offset
2022-06-30 10:54:00 【Fairy sword love】
Animation execution callback function
static void ofs_y_anim(void* img, int32_t v)
{
lv_img_set_offset_y(img, v); // Set up image control y Direction shift
}
Image styling and offset
/** * Image styling and offset */
static void lv_example_img_4(void)
{
LV_IMG_DECLARE(img_skew_strip); // Picture resource statement
static lv_style_t style;
lv_style_init(&style);
lv_style_set_bg_color(&style, lv_palette_main(LV_PALETTE_YELLOW)); // Background setting yellow
lv_style_set_bg_opa(&style, LV_OPA_COVER); // Transparency is Cover
lv_style_set_img_recolor_opa(&style, LV_OPA_COVER);// Set the transparency of the recolor to Cover
lv_style_set_img_recolor(&style, lv_color_black()); // Set the recolor color to black
lv_obj_t* img = lv_img_create(lv_scr_act()); // establish Image object
lv_obj_add_style(img, &style, 0); // add to style
lv_img_set_src(img, &img_skew_strip); // Set display picture source
lv_obj_set_size(img, 150, 100); // Set size
lv_obj_center(img); // centered
lv_anim_t a;
lv_anim_init(&a); // Initializing animation variables
lv_anim_set_var(&a, img); // Set the controls for the associated animation img
lv_anim_set_exec_cb(&a, ofs_y_anim); // Set the animation to execute the callback function
lv_anim_set_values(&a, 0, 100); // Set the start and end values of playback 0~100
lv_anim_set_time(&a, 3000); // Set animation playback duration 3000 millisecond
lv_anim_set_playback_time(&a, 500); // Set the animation replay time 500 millisecond
lv_anim_set_repeat_count(&a, LV_ANIM_REPEAT_INFINITE); // Set the number of animation restarts , Infinite times
lv_anim_start(&a); // Start animation playback
}
Run the renderings

边栏推荐
- The two e-commerce bigwigs' lacy news screens represent the return of e-commerce to normal, which will be beneficial to the real economy
- ArcGIS Pro scripting tool (5) - delete duplicates after sorting
- SGD有多种改进的形式,为什么大多数论文中仍然用SGD?
- Time complexity and space complexity
- Gd32 RT thread flash driver function
- 基于HAL库的LED驱动库
- LVGL 8.2 Checkboxes as radio buttons
- 国产自研系统的用户突破4亿,打破美国企业的垄断,谷歌后悔不迭
- 深潜Kotlin协程(十八):冷热数据流
- The precision problem of depth texture in unity shader - stepping pit - BRP pipeline (there is no solution, it is recommended to replace URP)
猜你喜欢

微信推出图片大爆炸功能;苹果自研 5G 芯片或已失败;微软解决导致 Edge 停止响应的 bug|极客头条...
![[STL source code analysis] iterator](/img/e8/7c69cf6e96ecfa053494397a21eff0.jpg)
[STL source code analysis] iterator

Auto SEG loss: automatic loss function design

LVGL 8.2 Image

Kernel linked list (general linked list) "list.h" simple version and individual comments
[email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled"/>Skill sorting [email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled

在 sCrypt 中实现高效的椭圆曲线点加法和乘法

【深度学习】深度学习检测小目标常用方法
[email protected] somatosensory manipulator"/>Skill combing [email protected] somatosensory manipulator

19:00 p.m. tonight, knowledge empowerment phase 2 live broadcast - control panel interface design of openharmony smart home project
随机推荐
Anhui "requirements for design depth of Hefei fabricated building construction drawing review" was printed and distributed; Hebei Hengshui city adjusts the pre-sale license standard for prefabricated
国产自研系统的用户突破4亿,打破美国企业的垄断,谷歌后悔不迭
电商两位大佬花边新闻刷屏,代表电商回归正常,将有利于实体经济
腾讯云数据库工程师能力认证重磅推出,各界共话人才培养难题
Auto SEG loss: automatic loss function design
Android 开发面试真题进阶版(附答案解析)
scratch绘制正方形 电子学会图形化编程scratch等级考试二级真题和答案解析2022年6月
From introduction to mastery of MySQL 50 lectures (32) -scylladb production environment cluster building
Pycharm项目使用pyinstalle打包过程中问题及解决方案
深潜Kotlin协程(十八):冷热数据流
Agile Development: super easy to use bucket estimation system
About Library (function library), dynamic library and static library
Collectors.toMap应用
如何解决跨域
数学知识复习:第二型曲线积分
China will force a unified charging interface. If Apple does not bow its head, iPhone will be kicked out of the Chinese market
pytorch 筆記 torch.nn.BatchNorm1d
Go zero micro Service Practice Series (VIII. How to handle tens of thousands of order requests per second)
无心剑中译狄金森《灵魂择其伴侣》
Skill combing [email protected] voice module +stm32+nfc