当前位置:网站首页>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 intelligent DNA molecular nano robot model is coming
- 超长干货 | Kubernetes命名空间详解
- 小程序中读取腾讯文档的表格数据
- Google 辟谣放弃 TensorFlow,它还活着!
- Dell et Apple, deux entreprises de PC établies, se sont effondrées rapidement
- 运动App如何实现端侧后台保活,让运动记录更完整?
- 电商两位大佬花边新闻刷屏,代表电商回归正常,将有利于实体经济
- ArrayList and sequence table
- Typescript – classes in Es5, inheritance, static methods
- 内存逃逸分析
猜你喜欢

煥發青春的戴爾和蘋果夾擊,兩大老牌PC企業極速衰敗

pytorch 筆記 torch.nn.BatchNorm1d

19:00 p.m. tonight, knowledge empowerment phase 2 live broadcast - control panel interface design of openharmony smart home project

The precision problem of depth texture in unity shader - stepping pit - BRP pipeline (there is no solution, it is recommended to replace URP)

Android 开发面试真题进阶版(附答案解析)

MATLAB image histogram equalization, namely spatial filtering

【STL源码剖析】容器(待补充)
![[STL source code analysis] container (to be supplemented)](/img/69/0c6e0e8ecb3ebc8c9b8503f5a8b4e5.jpg)
[STL source code analysis] container (to be supplemented)

文件共享服务器

CP2112使用USB转IIC通信教学示例
随机推荐
The number of users of the home-made self-developed system exceeded 400million, breaking the monopoly of American enterprises, and Google repented
Remember the experience of an internship. It is necessary to go to the pit (I)
Input a decimal data, convert to 8, using the sequence stack
DQN笔记
国产自研系统的用户突破4亿,打破美国企业的垄断,谷歌后悔不迭
Viewing technological changes through Huawei Corps (V): smart Park
LVGL 8.2 Image
Mysql database foundation: constraint and identification columns
电化学氧气传感器寿命、工作原理及应用介绍
Use keil5 software to simulate and debug gd32f305 from 0
腾讯云数据库工程师能力认证重磅推出,各界共话人才培养难题
历史上的今天:微软收购 PowerPoint 开发商;SGI 和 MIPS 合并
China will force a unified charging interface. If Apple does not bow its head, iPhone will be kicked out of the Chinese market
苹果高管公然“开怼”:三星抄袭 iPhone,只加了个大屏
CP2112使用USB转IIC通信教学示例
再测云原生数据库性能:PolarDB依旧最强,TDSQL-C、GaussDB变化不大
Mysql database foundation: views and variables
What is erdma as illustrated by Coptic cartoon?
June training (day 30) - topology sorting
数学知识复习:第二型曲线积分