当前位置:网站首页>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
边栏推荐
- From introduction to mastery of MySQL 50 lectures (32) -scylladb production environment cluster building
- ArrayList与顺序表
- LVGL8.2 Simple Checkboxes
- LVGL 8.2 Simple Image button
- MySQL导出sql脚本文件
- File sharing server
- What is erdma as illustrated by Coptic cartoon?
- Criu enables hot migration
- go-zero微服务实战系列(八、如何处理每秒上万次的下单请求)
- Qt之实现QQ天气预报窗体翻转效果
猜你喜欢
焕发青春的戴尔和苹果夹击,两大老牌PC企业极速衰败
ArrayList and sequence table
The two e-commerce bigwigs' lacy news screens represent the return of e-commerce to normal, which will be beneficial to the real economy
Use keil5 software to simulate and debug gd32f305 from 0
[STL source code analysis] iterator
matplotlib 笔记: contourf & contour
Matplotlib notes: contour & Contour
软件测试工程师面试基础题(应届生和测试小菜必备)最基础的面试题
[email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled"/>
Skill sorting [email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled
When does the database need to use the index [Hangzhou multi surveyors] [Hangzhou multi surveyors _ Wang Sir]
随机推荐
ArcGIS PRO + PS vectorized land use planning map
Skill combing [email protected] voice module +stm32+nfc
Time complexity and space complexity
Skill sorting [email protected]+ Alibaba cloud +nbiot+dht11+bh1750+ soil moisture sensor +oled
Double-DQN笔记
When does the database need to use the index [Hangzhou multi surveyors] [Hangzhou multi surveyors _ Wang Sir]
Android 开发面试真题进阶版(附答案解析)
腾讯云数据库工程师能力认证重磅推出,各界共话人才培养难题
Foresniffer tutorial: extracting data
蚂蚁金服笔试题:需求文档有什么可以量化的【杭州多测师】【杭州多测师_王sir】...
Criu enables hot migration
Gd32 RT thread RTC driver function
无心剑中译狄金森《灵魂择其伴侣》
软件测试工程师面试基础题(应届生和测试小菜必备)最基础的面试题
Auto SEG loss: automatic loss function design
The two e-commerce bigwigs' lacy news screens represent the return of e-commerce to normal, which will be beneficial to the real economy
Matplotlib notes: contour & Contour
LVGL 8.2 Checkboxes as radio buttons
Gd32 RT thread flash driver function
LVGL 8.2 Simple Drop down list